From 05a967a825383a60a333b380384e15d472d34898 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 17 Dec 2024 16:38:27 +0000 Subject: [PATCH] CodeGen from PR 31866 in Azure/azure-rest-api-specs Merge 7944bb7c0f7a09f762a20755a7377353ffa9a100 into 59799c650469a665614dd88c261ade7b78dcf77d --- .../azure-resourcemanager-quota/CHANGELOG.md | 165 +- .../azure-resourcemanager-quota/README.md | 4 +- .../azure-resourcemanager-quota/SAMPLE.md | 486 ++---- sdk/quota/azure-resourcemanager-quota/pom.xml | 2 +- .../resourcemanager/quota/QuotaManager.java | 65 +- .../quota/fluent/AzureQuotaExtensionApi.java | 26 +- .../quota/fluent/GroupQuotaLimitsClient.java | 103 +- .../GroupQuotaLimitsRequestsClient.java | 162 +- .../GroupQuotaLocationSettingsClient.java | 339 ---- ...aSubscriptionAllocationRequestsClient.java | 245 +-- ...oupQuotaSubscriptionAllocationsClient.java | 105 +- .../quota/fluent/GroupQuotaUsagesClient.java | 55 - .../fluent/models/GroupQuotaLimitInner.java | 166 -- ...ner.java => GroupQuotaLimitListInner.java} | 48 +- .../models/GroupQuotaUsagesBaseName.java | 110 -- .../fluent/models/GroupQuotasEntityInner.java | 18 +- .../SubscriptionQuotaAllocationsInner.java | 170 -- ...ubscriptionQuotaAllocationsListInner.java} | 44 +- .../AzureQuotaExtensionApiImpl.java | 62 +- ...Impl.java => GroupQuotaLimitListImpl.java} | 17 +- .../GroupQuotaLimitsClientImpl.java | 461 +----- .../implementation/GroupQuotaLimitsImpl.java | 39 +- .../GroupQuotaLimitsRequestsClientImpl.java | 671 ++------ .../GroupQuotaLimitsRequestsImpl.java | 37 +- .../GroupQuotaLocationSettingsClientImpl.java | 1440 ----------------- .../GroupQuotaLocationSettingsImpl.java | 112 -- ...scriptionAllocationRequestsClientImpl.java | 1131 +++++-------- ...otaSubscriptionAllocationRequestsImpl.java | 75 +- ...uotaSubscriptionAllocationsClientImpl.java | 463 +----- ...GroupQuotaSubscriptionAllocationsImpl.java | 41 +- .../GroupQuotaUsagesClientImpl.java | 319 ---- .../implementation/GroupQuotaUsagesImpl.java | 49 - .../GroupQuotasEnforcementResponseImpl.java | 50 - .../implementation/GroupQuotasEntityImpl.java | 4 +- .../implementation/ResourceUsagesImpl.java | 49 - ...SubscriptionQuotaAllocationsListImpl.java} | 16 +- .../quota/models/AdditionalAttributes.java | 133 -- .../models/AdditionalAttributesPatch.java | 126 -- .../quota/models/EnforcementState.java | 56 - .../quota/models/EnvironmentType.java | 51 - .../quota/models/GroupQuotaDetails.java | 101 +- .../quota/models/GroupQuotaLimit.java | 89 +- .../quota/models/GroupQuotaLimitList.java | 107 +- ...ava => GroupQuotaLimitListProperties.java} | 64 +- .../models/GroupQuotaLimitProperties.java | 199 +++ .../quota/models/GroupQuotaLimits.java | 99 +- .../models/GroupQuotaLimitsRequests.java | 79 +- .../models/GroupQuotaLocationSettings.java | 208 --- ...upQuotaSubscriptionAllocationRequests.java | 160 +- .../GroupQuotaSubscriptionAllocations.java | 100 +- .../GroupQuotaSubscriptionIdProperties.java | 16 +- .../quota/models/GroupQuotaUsages.java | 50 - .../quota/models/GroupQuotaUsagesBase.java | 197 --- .../GroupQuotasEnforcementListResponse.java | 117 -- .../GroupQuotasEnforcementResponse.java | 55 - ...upQuotasEnforcementResponseProperties.java | 130 -- .../quota/models/GroupQuotasEntity.java | 5 +- .../quota/models/GroupQuotasEntityBase.java | 40 +- .../models/GroupQuotasEntityBasePatch.java | 41 +- .../quota/models/GroupQuotasEntityPatch.java | 16 +- .../GroupQuotasEntityPatchProperties.java | 96 ++ .../models/GroupQuotasEntityProperties.java | 95 ++ .../quota/models/GroupingId.java | 124 -- .../quota/models/GroupingIdType.java | 51 - .../quota/models/ResourceUsages.java | 55 - .../models/SubscriptionQuotaAllocations.java | 92 +- .../SubscriptionQuotaAllocationsList.java | 108 +- ...riptionQuotaAllocationsListProperties.java | 134 ++ ...ubscriptionQuotaAllocationsProperties.java | 150 ++ .../models/SubscriptionQuotaDetails.java | 51 +- .../proxy-config.json | 2 +- .../generated/GroupQuotaLimitsGetSamples.java | 26 - .../GroupQuotaLimitsListSamples.java | 8 +- ...otaLimitsRequestCreateOrUpdateSamples.java | 26 - .../GroupQuotaLimitsRequestGetSamples.java | 4 +- .../GroupQuotaLimitsRequestListSamples.java | 4 +- .../GroupQuotaLimitsRequestUpdateSamples.java | 24 +- ...LocationSettingsCreateOrUpdateSamples.java | 51 - .../GroupQuotaLocationSettingsGetSamples.java | 26 - ...GroupQuotaLocationSettingsListSamples.java | 26 - ...oupQuotaLocationSettingsUpdateSamples.java | 32 - ...QuotaSubscriptionAllocationGetSamples.java | 26 - ...uotaSubscriptionAllocationListSamples.java | 9 +- ...llocationRequestCreateOrUpdateSamples.java | 32 - ...bscriptionAllocationRequestGetSamples.java | 4 +- ...scriptionAllocationRequestListSamples.java | 2 +- ...riptionAllocationRequestUpdateSamples.java | 21 +- ...upQuotaSubscriptionRequestsGetSamples.java | 2 +- ...pQuotaSubscriptionRequestsListSamples.java | 2 +- ...otaSubscriptionsCreateOrUpdateSamples.java | 4 +- .../GroupQuotaSubscriptionsDeleteSamples.java | 4 +- .../GroupQuotaSubscriptionsGetSamples.java | 4 +- .../GroupQuotaSubscriptionsListSamples.java | 4 +- .../GroupQuotaSubscriptionsUpdateSamples.java | 4 +- .../GroupQuotaUsagesListSamples.java | 26 - .../GroupQuotasCreateOrUpdateSamples.java | 17 +- .../generated/GroupQuotasDeleteSamples.java | 4 +- .../generated/GroupQuotasGetSamples.java | 3 +- .../generated/GroupQuotasListSamples.java | 4 +- .../generated/GroupQuotasUpdateSamples.java | 16 +- .../generated/QuotaCreateOrUpdateSamples.java | 12 +- .../quota/generated/QuotaGetSamples.java | 8 +- .../quota/generated/QuotaListSamples.java | 8 +- .../generated/QuotaOperationListSamples.java | 2 +- .../QuotaRequestStatusGetSamples.java | 13 +- .../QuotaRequestStatusListSamples.java | 3 +- .../quota/generated/QuotaUpdateSamples.java | 8 +- .../quota/generated/UsagesGetSamples.java | 6 +- .../quota/generated/UsagesListSamples.java | 9 +- .../AdditionalAttributesPatchTests.java | 35 - .../generated/AdditionalAttributesTests.java | 35 - ...AllocatedQuotaToSubscriptionListTests.java | 34 - .../AllocatedToSubscriptionTests.java | 29 - .../CurrentQuotaLimitBaseInnerTests.java | 35 - .../CurrentUsagesBaseInnerTests.java | 40 - .../generated/GroupQuotaDetailsNameTests.java | 23 - .../generated/GroupQuotaDetailsTests.java | 31 - .../generated/GroupQuotaLimitInnerTests.java | 34 - .../generated/GroupQuotaLimitListTests.java | 37 - ...upQuotaLimitsGetWithResponseMockTests.java | 42 - .../GroupQuotaLimitsListMockTests.java | 41 - .../quota/generated/GroupQuotaListTests.java | 72 - ...upQuotaRequestBasePropertiesNameTests.java | 23 - .../GroupQuotaRequestBasePropertiesTests.java | 32 - .../generated/GroupQuotaRequestBaseTests.java | 31 - ...onAllocationsGetWithResponseMockTests.java | 40 - ...aSubscriptionAllocationsListMockTests.java | 40 - .../GroupQuotaSubscriptionIdInnerTests.java | 25 - .../GroupQuotaSubscriptionIdListTests.java | 27 - ...oupQuotaSubscriptionIdPropertiesTests.java | 23 - ...taSubscriptionRequestStatusInnerTests.java | 32 - ...otaSubscriptionRequestStatusListTests.java | 44 - ...scriptionRequestStatusPropertiesTests.java | 31 - ...ptionRequestsGetWithResponseMockTests.java | 41 - ...uotaSubscriptionRequestsListMockTests.java | 41 - ...aSubscriptionsCreateOrUpdateMockTests.java | 35 - ...SubscriptionsGetWithResponseMockTests.java | 37 - .../GroupQuotaSubscriptionsListMockTests.java | 37 - ...roupQuotaSubscriptionsUpdateMockTests.java | 36 - .../GroupQuotaUsagesBaseNameTests.java | 25 - .../generated/GroupQuotaUsagesBaseTests.java | 32 - .../GroupQuotaUsagesListMockTests.java | 41 - .../GroupQuotasCreateOrUpdateMockTests.java | 46 - .../GroupQuotasEntityBasePatchTests.java | 41 - .../generated/GroupQuotasEntityBaseTests.java | 41 - .../GroupQuotasEntityInnerTests.java | 45 - .../GroupQuotasEntityPatchTests.java | 45 - .../GroupQuotasGetWithResponseMockTests.java | 45 - .../generated/GroupQuotasListMockTests.java | 46 - .../generated/GroupQuotasUpdateMockTests.java | 54 - .../quota/generated/GroupingIdTests.java | 28 - .../quota/generated/LimitJsonObjectTests.java | 22 - .../quota/generated/LimitObjectTests.java | 29 - .../generated/LroResponseInnerTests.java | 24 - .../generated/LroResponsePropertiesTests.java | 22 - .../generated/OperationDisplayTests.java | 36 - .../quota/generated/OperationListTests.java | 66 - .../OperationResponseInnerTests.java | 42 - ...ocationRequestBasePropertiesNameTests.java | 23 - ...aAllocationRequestBasePropertiesTests.java | 29 - .../QuotaAllocationRequestBaseTests.java | 29 - .../quota/generated/QuotaLimitsTests.java | 52 - .../QuotaOperationsListMockTests.java | 43 - .../quota/generated/QuotaPropertiesTests.java | 33 - .../QuotasCreateOrUpdateMockTests.java | 48 - .../QuotasGetWithResponseMockTests.java | 39 - .../quota/generated/QuotasListMockTests.java | 40 - .../quota/generated/ResourceNameTests.java | 25 - .../generated/ResourceUsageListTests.java | 39 - .../generated/ResourceUsagesInnerTests.java | 34 - .../quota/generated/SubRequestTests.java | 32 - ...ubscriptionQuotaAllocationsInnerTests.java | 30 - ...SubscriptionQuotaAllocationsListTests.java | 37 - .../SubscriptionQuotaDetailsNameTests.java | 22 - .../SubscriptionQuotaDetailsTests.java | 29 - .../UsagesGetWithResponseMockTests.java | 43 - .../quota/generated/UsagesLimitsTests.java | 46 - .../quota/generated/UsagesListMockTests.java | 43 - .../quota/generated/UsagesObjectTests.java | 28 - .../generated/UsagesPropertiesTests.java | 39 - 180 files changed, 2499 insertions(+), 11107 deletions(-) delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitInner.java rename sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/{ResourceUsagesInner.java => GroupQuotaLimitListInner.java} (66%) delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsInner.java rename sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/{GroupQuotasEnforcementResponseInner.java => SubscriptionQuotaAllocationsListInner.java} (66%) rename sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/{GroupQuotaLimitImpl.java => GroupQuotaLimitListImpl.java} (65%) delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementResponseImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java rename sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/{SubscriptionQuotaAllocationsImpl.java => SubscriptionQuotaAllocationsListImpl.java} (68%) delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributes.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributesPatch.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnvironmentType.java rename sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/{ResourceUsageList.java => GroupQuotaLimitListProperties.java} (50%) create mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementListResponse.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponse.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponseProperties.java create mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java create mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingId.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingIdType.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java create mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java create mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestCreateOrUpdateSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsListSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationGetSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesPatchTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedQuotaToSubscriptionListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedToSubscriptionTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentQuotaLimitBaseInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentUsagesBaseInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBaseTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdPropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusPropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBasePatchTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBaseTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityPatchTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupingIdTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitJsonObjectTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitObjectTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponseInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponsePropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationDisplayTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationResponseInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBaseTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaLimitsTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaOperationsListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaPropertiesTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasCreateOrUpdateMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsageListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsagesInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubRequestTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsInnerTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsListTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsNameTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesGetWithResponseMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesLimitsTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesListMockTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesObjectTests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesPropertiesTests.java diff --git a/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md b/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md index e4427ad61abd4..38a1591848d10 100644 --- a/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md +++ b/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md @@ -1,14 +1,171 @@ # Release History -## 1.1.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2024-12-17) + +- Azure Resource Manager quota client library for Java. This package contains Microsoft Azure SDK for quota Management SDK. Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. Package tag package-2024-12-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.SubscriptionQuotaAllocationsListProperties` was added + +* `models.GroupQuotasEntityBasePatch` was added + +* `models.GroupQuotaRequestBase` was added + +* `models.SubscriptionQuotaAllocationsProperties` was added + +* `models.GroupQuotasEntityBase` was added + +* `models.GroupQuotasEntityPatch` was added + +* `models.SubscriptionQuotaDetails` was added + +* `models.GroupQuotas` was added + +* `models.GroupQuotaSubscriptionRequests` was added + +* `models.GroupQuotaSubscriptionRequestStatus` was added + +* `models.GroupQuotasEntityPatchProperties` was added + +* `models.SubscriptionQuotaAllocations` was added + +* `models.GroupQuotasEntityProperties` was added + +* `models.RequestState` was added + +* `models.GroupQuotaLimits` was added + +* `models.GroupQuotaLimitProperties` was added + +* `models.QuotaAllocationRequestBase` was added + +* `models.GroupQuotaSubscriptionIdProperties` was added + +* `models.GroupQuotaSubscriptions` was added + +* `models.SubscriptionQuotaAllocationsList` was added + +* `models.QuotaAllocationRequestStatusList` was added + +* `models.GroupQuotaSubscriptionAllocationRequests` was added + +* `models.AllocatedQuotaToSubscriptionList` was added + +* `models.SubmittedResourceRequestStatusProperties` was added + +* `models.SubmittedResourceRequestStatus` was added + +* `models.SubmittedResourceRequestStatusList` was added + +* `models.GroupQuotaList` was added + +* `models.QuotaAllocationRequestStatus` was added + +* `models.LroResponseProperties` was added + +* `models.LroResponse` was added + +* `models.GroupQuotaSubscriptionRequestStatusProperties` was added + +* `models.GroupQuotaLimitsRequests` was added + +* `models.GroupQuotaLimit` was added + +* `models.GroupQuotaLimitList` was added + +* `models.GroupQuotaDetails` was added + +* `models.GroupQuotaSubscriptionAllocations` was added + +* `models.GroupQuotaLimitListProperties` was added + +* `models.GroupQuotaSubscriptionRequestStatusList` was added + +* `models.GroupQuotaSubscriptionIdList` was added + +* `models.AllocatedToSubscription` was added + +* `models.GroupQuotasEntity` was added + +* `models.GroupQuotaSubscriptionId` was added + +#### `models.UsagesLimits` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UsagesObject` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.QuotaProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.ServiceErrorDetail` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `QuotaManager` was modified + +* `groupQuotas()` was added +* `groupQuotaSubscriptionRequests()` was added +* `groupQuotaSubscriptionAllocationRequests()` was added +* `groupQuotaSubscriptionAllocations()` was added +* `groupQuotaLimits()` was added +* `groupQuotaLimitsRequests()` was added +* `groupQuotaSubscriptions()` was added + +#### `models.ResourceName` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.QuotaLimits` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.QuotaRequestDetailsList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.LimitObject` was modified + +* `limitObjectType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.LimitJsonObject` was modified + +* `limitObjectType()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.SubRequest` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.OperationList` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added -### Bugs Fixed +#### `models.UsagesProperties` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.1.0-beta.2 (2024-12-04) diff --git a/sdk/quota/azure-resourcemanager-quota/README.md b/sdk/quota/azure-resourcemanager-quota/README.md index 5ad19112c221e..9e2d3e15674d9 100644 --- a/sdk/quota/azure-resourcemanager-quota/README.md +++ b/sdk/quota/azure-resourcemanager-quota/README.md @@ -2,7 +2,7 @@ Azure Resource Manager quota client library for Java. -This package contains Microsoft Azure SDK for quota Management SDK. Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. Package tag package-2023-06-01-preview. 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 quota Management SDK. Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. Package tag package-2024-12-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-quota - 1.1.0-beta.2 + 1.1.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/quota/azure-resourcemanager-quota/SAMPLE.md b/sdk/quota/azure-resourcemanager-quota/SAMPLE.md index 0bbb13249f627..4901db54765b9 100644 --- a/sdk/quota/azure-resourcemanager-quota/SAMPLE.md +++ b/sdk/quota/azure-resourcemanager-quota/SAMPLE.md @@ -3,31 +3,20 @@ ## GroupQuotaLimits -- [Get](#groupquotalimits_get) - [List](#groupquotalimits_list) ## GroupQuotaLimitsRequest -- [CreateOrUpdate](#groupquotalimitsrequest_createorupdate) - [Get](#groupquotalimitsrequest_get) - [List](#groupquotalimitsrequest_list) - [Update](#groupquotalimitsrequest_update) -## GroupQuotaLocationSettings - -- [CreateOrUpdate](#groupquotalocationsettings_createorupdate) -- [Get](#groupquotalocationsettings_get) -- [List](#groupquotalocationsettings_list) -- [Update](#groupquotalocationsettings_update) - ## GroupQuotaSubscriptionAllocation -- [Get](#groupquotasubscriptionallocation_get) - [List](#groupquotasubscriptionallocation_list) ## GroupQuotaSubscriptionAllocationRequest -- [CreateOrUpdate](#groupquotasubscriptionallocationrequest_createorupdate) - [Get](#groupquotasubscriptionallocationrequest_get) - [List](#groupquotasubscriptionallocationrequest_list) - [Update](#groupquotasubscriptionallocationrequest_update) @@ -45,10 +34,6 @@ - [List](#groupquotasubscriptions_list) - [Update](#groupquotasubscriptions_update) -## GroupQuotaUsages - -- [List](#groupquotausages_list) - ## GroupQuotas - [CreateOrUpdate](#groupquotas_createorupdate) @@ -77,31 +62,6 @@ - [Get](#usages_get) - [List](#usages_list) -### GroupQuotaLimits_Get - -```java -/** - * Samples for GroupQuotaLimits Get. - */ -public final class GroupQuotaLimitsGetSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimits/ - * GetGroupQuotaLimits-Compute.json - */ - /** - * Sample code: GroupQuotaLimits_Get_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLimitsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLimits() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "cores", - "location eq westus", com.azure.core.util.Context.NONE); - } -} -``` - ### GroupQuotaLimits_List ```java @@ -111,48 +71,22 @@ public final class GroupQuotaLimitsGetSamples { public final class GroupQuotaLimitsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimits/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimits/ * ListGroupQuotaLimits-Compute.json */ /** - * Sample code: GroupQuotaLimits_List_Request_ForCompute. + * Sample code: GroupQuotaLimits_Get_Request_ForCompute. * * @param manager Entry point to QuotaManager. */ - public static void groupQuotaLimitsListRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { + public static void groupQuotaLimitsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaLimits() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "location eq westus", + .listWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", com.azure.core.util.Context.NONE); } } ``` -### GroupQuotaLimitsRequest_CreateOrUpdate - -```java - -/** - * Samples for GroupQuotaLimitsRequest CreateOrUpdate. - */ -public final class GroupQuotaLimitsRequestCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /PutGroupQuotaLimitsRequests-Compute.json - */ - /** - * Sample code: GroupQuotaLimitsRequests_CreateOrUpdate. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLimitsRequestsCreateOrUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLimitsRequests() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - "standardav2family", null, com.azure.core.util.Context.NONE); - } -} -``` - ### GroupQuotaLimitsRequest_Get ```java @@ -162,8 +96,8 @@ public final class GroupQuotaLimitsRequestCreateOrUpdateSamples { public final class GroupQuotaLimitsRequestGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /GroupQuotaLimitsRequests_Get.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * GroupQuotaLimitsRequests_Get.json */ /** * Sample code: GroupQuotaLimitsRequests_Get. @@ -187,8 +121,8 @@ public final class GroupQuotaLimitsRequestGetSamples { public final class GroupQuotaLimitsRequestListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /GroupQuotaLimitsRequests_List.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * GroupQuotaLimitsRequests_List.json */ /** * Sample code: GroupQuotaLimitsRequest_List. @@ -206,6 +140,11 @@ public final class GroupQuotaLimitsRequestListSamples { ### GroupQuotaLimitsRequest_Update ```java +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; +import com.azure.resourcemanager.quota.models.GroupQuotaLimit; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitProperties; +import java.util.Arrays; /** * Samples for GroupQuotaLimitsRequest Update. @@ -213,8 +152,8 @@ public final class GroupQuotaLimitsRequestListSamples { public final class GroupQuotaLimitsRequestUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /PatchGroupQuotaLimitsRequests-Compute.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * PatchGroupQuotaLimitsRequests-Compute.json */ /** * Sample code: GroupQuotaLimitsRequests_Update. @@ -223,168 +162,22 @@ public final class GroupQuotaLimitsRequestUpdateSamples { */ public static void groupQuotaLimitsRequestsUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaLimitsRequests() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "standardav2family", - null, com.azure.core.util.Context.NONE); - } -} -``` - -### GroupQuotaLocationSettings_CreateOrUpdate - -```java -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.EnforcementState; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; - -/** - * Samples for GroupQuotaLocationSettings CreateOrUpdate. - */ -public final class GroupQuotaLocationSettingsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PutGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaLocationSettings_CreateOrUpdate. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLocationSettingsCreateOrUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PutGroupQuotaEnforcementFailed.json - */ - /** - * Sample code: GroupQuotaLocationSettings_CreateOrUpdate_Failed. - * - * @param manager Entry point to QuotaManager. - */ - public static void - groupQuotaLocationSettingsCreateOrUpdateFailed(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), - com.azure.core.util.Context.NONE); - } -} -``` - -### GroupQuotaLocationSettings_Get - -```java -/** - * Samples for GroupQuotaLocationSettings Get. - */ -public final class GroupQuotaLocationSettingsGetSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * GetGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotasEnforcement_Get. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotasEnforcementGet(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - com.azure.core.util.Context.NONE); - } -} -``` - -### GroupQuotaLocationSettings_List - -```java -/** - * Samples for GroupQuotaLocationSettings List. - */ -public final class GroupQuotaLocationSettingsListSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * ListGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaEnforcement_List. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaEnforcementList(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - com.azure.core.util.Context.NONE); - } -} -``` - -### GroupQuotaLocationSettings_Update - -```java -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.EnforcementState; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; - -/** - * Samples for GroupQuotaLocationSettings Update. - */ -public final class GroupQuotaLocationSettingsUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PatchGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaLocationSettings_Patch. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLocationSettingsPatch(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), + .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", + new GroupQuotaLimitListInner() + .withProperties(new GroupQuotaLimitListProperties().withValue(Arrays.asList( + new GroupQuotaLimit() + .withProperties(new GroupQuotaLimitProperties().withResourceName("standardddv4family") + .withLimit(110L) + .withComment("Contoso requires more quota.")), + new GroupQuotaLimit() + .withProperties(new GroupQuotaLimitProperties().withResourceName("standardav2family") + .withLimit(110L) + .withComment("Contoso requires more quota."))))), com.azure.core.util.Context.NONE); } } ``` -### GroupQuotaSubscriptionAllocation_Get - -```java -/** - * Samples for GroupQuotaSubscriptionAllocation Get. - */ -public final class GroupQuotaSubscriptionAllocationGetSamples { - /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_Get-Compute.json - */ - /** - * Sample code: SubscriptionQuotaAllocation_Get_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void - subscriptionQuotaAllocationGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaSubscriptionAllocations() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "standardav2family", - "provider eq Microsoft.Compute & location eq westus", com.azure.core.util.Context.NONE); - } -} -``` - ### GroupQuotaSubscriptionAllocation_List ```java @@ -393,8 +186,9 @@ public final class GroupQuotaSubscriptionAllocationGetSamples { */ public final class GroupQuotaSubscriptionAllocationListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionQuotaAllocation/ + * SubscriptionQuotaAllocation_List-Compute.json */ /** * Sample code: SubscriptionQuotaAllocation_List_ForCompute. @@ -403,38 +197,7 @@ public final class GroupQuotaSubscriptionAllocationListSamples { */ public static void subscriptionQuotaAllocationListForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocations() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", - "provider eq Microsoft.Compute & location eq westus", com.azure.core.util.Context.NONE); - } -} -``` - -### GroupQuotaSubscriptionAllocationRequest_CreateOrUpdate - -```java -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; - -/** - * Samples for GroupQuotaSubscriptionAllocationRequest CreateOrUpdate. - */ -public final class GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocationRequests/PutSubscriptionQuotaAllocationRequest-Compute.json - */ - /** - * Sample code: SubscriptionQuotaAllocation_Put_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void - subscriptionQuotaAllocationPutRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaSubscriptionAllocationRequests() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - "standardav2family", - new QuotaAllocationRequestStatusInner() - .withRequestedResource(new QuotaAllocationRequestBase().withLimit(10L).withRegion("westus")), + .listWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", com.azure.core.util.Context.NONE); } } @@ -448,7 +211,7 @@ public final class GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples */ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json */ /** @@ -459,7 +222,7 @@ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { public static void subscriptionQuotaAllocationRequestsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocationRequests() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", + .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "AE000000-0000-0000-0000-00000000000A", com.azure.core.util.Context.NONE); } } @@ -473,7 +236,7 @@ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { */ public final class GroupQuotaSubscriptionAllocationRequestListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json */ /** @@ -493,15 +256,18 @@ public final class GroupQuotaSubscriptionAllocationRequestListSamples { ### GroupQuotaSubscriptionAllocationRequest_Update ```java -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsProperties; +import java.util.Arrays; /** * Samples for GroupQuotaSubscriptionAllocationRequest Update. */ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json */ /** @@ -512,9 +278,15 @@ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { public static void subscriptionQuotaAllocationPatchRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocationRequests() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "standardav2family", - new QuotaAllocationRequestStatusInner() - .withRequestedResource(new QuotaAllocationRequestBase().withLimit(10L).withRegion("westus")), + .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", + new SubscriptionQuotaAllocationsListInner() + .withProperties(new SubscriptionQuotaAllocationsListProperties().withValue(Arrays.asList( + new SubscriptionQuotaAllocations().withProperties( + new SubscriptionQuotaAllocationsProperties().withResourceName("standardddv4family") + .withLimit(110L)), + new SubscriptionQuotaAllocations().withProperties( + new SubscriptionQuotaAllocationsProperties().withResourceName("standardav2family") + .withLimit(110L))))), com.azure.core.util.Context.NONE); } } @@ -529,7 +301,7 @@ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { public final class GroupQuotaSubscriptionRequestsGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionRequests/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionRequests/ * SubscriptionRequests_Get.json */ /** @@ -554,7 +326,7 @@ public final class GroupQuotaSubscriptionRequestsGetSamples { public final class GroupQuotaSubscriptionRequestsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionRequests/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionRequests/ * SubscriptionRequests_List.json */ /** @@ -578,8 +350,8 @@ public final class GroupQuotaSubscriptionRequestsListSamples { public final class GroupQuotaSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /PutGroupQuotasSubscription.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * PutGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Put_Subscriptions. @@ -602,8 +374,8 @@ public final class GroupQuotaSubscriptionsCreateOrUpdateSamples { public final class GroupQuotaSubscriptionsDeleteSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /DeleteGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * DeleteGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Delete_Subscriptions. @@ -627,8 +399,8 @@ public final class GroupQuotaSubscriptionsDeleteSamples { public final class GroupQuotaSubscriptionsGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /GetGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * GetGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Get_Subscriptions. @@ -651,8 +423,8 @@ public final class GroupQuotaSubscriptionsGetSamples { public final class GroupQuotaSubscriptionsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /ListGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * ListGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_List_Subscriptions. @@ -675,8 +447,8 @@ public final class GroupQuotaSubscriptionsListSamples { public final class GroupQuotaSubscriptionsUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /PatchGroupQuotasSubscription.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * PatchGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Patch_Subscriptions. @@ -690,40 +462,11 @@ public final class GroupQuotaSubscriptionsUpdateSamples { } ``` -### GroupQuotaUsages_List - -```java -/** - * Samples for GroupQuotaUsages List. - */ -public final class GroupQuotaUsagesListSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaUsages/ - * GetGroupQuotaUsages.json - */ - /** - * Sample code: GroupQuotasUsages_List. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotasUsagesList(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaUsages() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", - com.azure.core.util.Context.NONE); - } -} -``` - ### GroupQuotas_CreateOrUpdate ```java import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; /** * Samples for GroupQuotas CreateOrUpdate. @@ -731,8 +474,7 @@ import com.azure.resourcemanager.quota.models.GroupingIdType; public final class GroupQuotasCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * PutGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/PutGroupQuotas.json */ /** * Sample code: GroupQuotas_Put_Request_ForCompute. @@ -743,13 +485,7 @@ public final class GroupQuotasCreateOrUpdateSamples { manager.groupQuotas() .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", new GroupQuotasEntityInner() - .withProperties( - new GroupQuotasEntityBase().withDisplayName("GroupQuota1") - .withAdditionalAttributes( - new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID) - .withValue("yourServiceTreeIdHere")) - .withEnvironment(EnvironmentType.PRODUCTION))), + .withProperties(new GroupQuotasEntityProperties().withDisplayName("GroupQuota1")), com.azure.core.util.Context.NONE); } } @@ -764,8 +500,8 @@ public final class GroupQuotasCreateOrUpdateSamples { public final class GroupQuotasDeleteSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * DeleteGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/DeleteGroupQuotas. + * json */ /** * Sample code: GroupQuotas_Delete_Request_ForCompute. @@ -788,8 +524,7 @@ public final class GroupQuotasDeleteSamples { public final class GroupQuotasGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * GetGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/GetGroupQuotas.json */ /** * Sample code: GroupQuotas_Get_Request_ForCompute. @@ -812,8 +547,8 @@ public final class GroupQuotasGetSamples { public final class GroupQuotasListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * GetGroupQuotasList.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/GetGroupQuotasList. + * json */ /** * Sample code: GroupQuotas_List_Request_ForCompute. @@ -829,12 +564,8 @@ public final class GroupQuotasListSamples { ### GroupQuotas_Update ```java -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBasePatch; import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatchProperties; /** * Samples for GroupQuotas Update. @@ -842,8 +573,7 @@ import com.azure.resourcemanager.quota.models.GroupingIdType; public final class GroupQuotasUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * PatchGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/PatchGroupQuotas.json */ /** * Sample code: GroupQuotas_Patch_Request_ForCompute. @@ -854,12 +584,7 @@ public final class GroupQuotasUpdateSamples { manager.groupQuotas() .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", new GroupQuotasEntityPatch() - .withProperties( - new GroupQuotasEntityBasePatch().withDisplayName("UpdatedGroupQuota1") - .withAdditionalAttributes(new AdditionalAttributesPatch() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID) - .withValue("UpdatedServiceTreeIdHere")) - .withEnvironment(EnvironmentType.PRODUCTION))), + .withProperties(new GroupQuotasEntityPatchProperties().withDisplayName("UpdatedGroupQuota1")), com.azure.core.util.Context.NONE); } } @@ -877,7 +602,7 @@ import com.azure.resourcemanager.quota.models.ResourceName; */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * putMachineLearningServicesQuotaRequestLowPriority.json */ /** @@ -898,7 +623,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json */ /** @@ -919,8 +644,8 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * putComputeOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Put_Request_ForCompute. @@ -938,8 +663,8 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * putNetworkOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/putNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_PutRequest_ForNetwork. @@ -967,8 +692,8 @@ public final class QuotaCreateOrUpdateSamples { */ public final class QuotaGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getNetworkOneSkuQuotaLimit.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkOneSkuQuotaLimit.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -983,8 +708,8 @@ public final class QuotaGetSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getComputeOneSkuQuotaLimit.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeOneSkuQuotaLimit.json */ /** * Sample code: Quotas_Get_Request_ForCompute. @@ -1008,7 +733,7 @@ public final class QuotaGetSamples { */ public final class QuotaListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * getMachineLearningServicesQuotaLimits.json */ /** @@ -1026,8 +751,7 @@ public final class QuotaListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeQuotaLimits. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForCompute. @@ -1042,8 +766,7 @@ public final class QuotaListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkQuotaLimits. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForNetwork. @@ -1072,8 +795,7 @@ import com.azure.resourcemanager.quota.models.ResourceName; public final class QuotaUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/patchComputeQuotaRequest - * .json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -1093,8 +815,9 @@ public final class QuotaUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * patchNetworkOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/patchNetworkOneSkuQuotaRequest. + * json */ /** * Sample code: Quotas_Request_PatchForNetwork. @@ -1125,7 +848,7 @@ public final class QuotaUpdateSamples { public final class QuotaOperationListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GetOperations.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GetOperations.json */ /** * Sample code: GetOperations. @@ -1146,8 +869,8 @@ public final class QuotaOperationListSamples { */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusFailed.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -1162,8 +885,8 @@ public final class QuotaRequestStatusGetSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusById.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -1178,8 +901,9 @@ public final class QuotaRequestStatusGetSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusInProgress.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusInProgress. + * json */ /** * Sample code: QuotaRequestInProgress. @@ -1204,8 +928,7 @@ public final class QuotaRequestStatusGetSamples { public final class QuotaRequestStatusListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestsHistory. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. @@ -1229,8 +952,7 @@ public final class QuotaRequestStatusListSamples { public final class UsagesGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkOneSkuUsages. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -1246,8 +968,7 @@ public final class UsagesGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeOneSkuUsages. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForCompute. @@ -1272,7 +993,7 @@ public final class UsagesGetSamples { public final class UsagesListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeUsages.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -1287,7 +1008,7 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkUsages.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkUsages.json */ /** * Sample code: Quotas_listUsagesForNetwork. @@ -1301,8 +1022,9 @@ public final class UsagesListSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getMachineLearningServicesUsages.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getMachineLearningServicesUsages. + * json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. diff --git a/sdk/quota/azure-resourcemanager-quota/pom.xml b/sdk/quota/azure-resourcemanager-quota/pom.xml index c80148fc74e40..d5cc9aa92fe9d 100644 --- a/sdk/quota/azure-resourcemanager-quota/pom.xml +++ b/sdk/quota/azure-resourcemanager-quota/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for quota Management - This package contains Microsoft Azure SDK for quota Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. Package tag package-2023-06-01-preview. + This package contains Microsoft Azure SDK for quota Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota using GroupQuota Entity. Package tag package-2024-12-12. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java index 2ad7d787c26fd..811d9e6e43ae0 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java @@ -27,12 +27,10 @@ import com.azure.resourcemanager.quota.implementation.AzureQuotaExtensionApiBuilder; import com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotasImpl; import com.azure.resourcemanager.quota.implementation.QuotaOperationsImpl; import com.azure.resourcemanager.quota.implementation.QuotaRequestStatusImpl; @@ -40,12 +38,10 @@ import com.azure.resourcemanager.quota.implementation.UsagesImpl; import com.azure.resourcemanager.quota.models.GroupQuotaLimits; import com.azure.resourcemanager.quota.models.GroupQuotaLimitsRequests; -import com.azure.resourcemanager.quota.models.GroupQuotaLocationSettings; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocationRequests; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocations; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequests; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptions; -import com.azure.resourcemanager.quota.models.GroupQuotaUsages; import com.azure.resourcemanager.quota.models.GroupQuotas; import com.azure.resourcemanager.quota.models.QuotaOperations; import com.azure.resourcemanager.quota.models.QuotaRequestStatus; @@ -69,17 +65,13 @@ public final class QuotaManager { private GroupQuotaSubscriptionRequests groupQuotaSubscriptionRequests; - private GroupQuotaLimits groupQuotaLimits; - private GroupQuotaLimitsRequests groupQuotaLimitsRequests; - private GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations; + private GroupQuotaLimits groupQuotaLimits; private GroupQuotaSubscriptionAllocationRequests groupQuotaSubscriptionAllocationRequests; - private GroupQuotaUsages groupQuotaUsages; - - private GroupQuotaLocationSettings groupQuotaLocationSettings; + private GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations; private Usages usages; @@ -253,7 +245,7 @@ public QuotaManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.quota") .append("/") - .append("1.1.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -337,18 +329,6 @@ public GroupQuotaSubscriptionRequests groupQuotaSubscriptionRequests() { return groupQuotaSubscriptionRequests; } - /** - * Gets the resource collection API of GroupQuotaLimits. - * - * @return Resource collection API of GroupQuotaLimits. - */ - public GroupQuotaLimits groupQuotaLimits() { - if (this.groupQuotaLimits == null) { - this.groupQuotaLimits = new GroupQuotaLimitsImpl(clientObject.getGroupQuotaLimits(), this); - } - return groupQuotaLimits; - } - /** * Gets the resource collection API of GroupQuotaLimitsRequests. * @@ -363,16 +343,15 @@ public GroupQuotaLimitsRequests groupQuotaLimitsRequests() { } /** - * Gets the resource collection API of GroupQuotaSubscriptionAllocations. + * Gets the resource collection API of GroupQuotaLimits. * - * @return Resource collection API of GroupQuotaSubscriptionAllocations. + * @return Resource collection API of GroupQuotaLimits. */ - public GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations() { - if (this.groupQuotaSubscriptionAllocations == null) { - this.groupQuotaSubscriptionAllocations - = new GroupQuotaSubscriptionAllocationsImpl(clientObject.getGroupQuotaSubscriptionAllocations(), this); + public GroupQuotaLimits groupQuotaLimits() { + if (this.groupQuotaLimits == null) { + this.groupQuotaLimits = new GroupQuotaLimitsImpl(clientObject.getGroupQuotaLimits(), this); } - return groupQuotaSubscriptionAllocations; + return groupQuotaLimits; } /** @@ -389,28 +368,16 @@ public GroupQuotaSubscriptionAllocationRequests groupQuotaSubscriptionAllocation } /** - * Gets the resource collection API of GroupQuotaUsages. - * - * @return Resource collection API of GroupQuotaUsages. - */ - public GroupQuotaUsages groupQuotaUsages() { - if (this.groupQuotaUsages == null) { - this.groupQuotaUsages = new GroupQuotaUsagesImpl(clientObject.getGroupQuotaUsages(), this); - } - return groupQuotaUsages; - } - - /** - * Gets the resource collection API of GroupQuotaLocationSettings. + * Gets the resource collection API of GroupQuotaSubscriptionAllocations. * - * @return Resource collection API of GroupQuotaLocationSettings. + * @return Resource collection API of GroupQuotaSubscriptionAllocations. */ - public GroupQuotaLocationSettings groupQuotaLocationSettings() { - if (this.groupQuotaLocationSettings == null) { - this.groupQuotaLocationSettings - = new GroupQuotaLocationSettingsImpl(clientObject.getGroupQuotaLocationSettings(), this); + public GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations() { + if (this.groupQuotaSubscriptionAllocations == null) { + this.groupQuotaSubscriptionAllocations + = new GroupQuotaSubscriptionAllocationsImpl(clientObject.getGroupQuotaSubscriptionAllocations(), this); } - return groupQuotaLocationSettings; + return groupQuotaSubscriptionAllocations; } /** diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/AzureQuotaExtensionApi.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/AzureQuotaExtensionApi.java index 44d3db678de35..708c3a71301f7 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/AzureQuotaExtensionApi.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/AzureQuotaExtensionApi.java @@ -67,13 +67,6 @@ public interface AzureQuotaExtensionApi { */ GroupQuotaSubscriptionRequestsClient getGroupQuotaSubscriptionRequests(); - /** - * Gets the GroupQuotaLimitsClient object to access its operations. - * - * @return the GroupQuotaLimitsClient object. - */ - GroupQuotaLimitsClient getGroupQuotaLimits(); - /** * Gets the GroupQuotaLimitsRequestsClient object to access its operations. * @@ -82,11 +75,11 @@ public interface AzureQuotaExtensionApi { GroupQuotaLimitsRequestsClient getGroupQuotaLimitsRequests(); /** - * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. + * Gets the GroupQuotaLimitsClient object to access its operations. * - * @return the GroupQuotaSubscriptionAllocationsClient object. + * @return the GroupQuotaLimitsClient object. */ - GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations(); + GroupQuotaLimitsClient getGroupQuotaLimits(); /** * Gets the GroupQuotaSubscriptionAllocationRequestsClient object to access its operations. @@ -96,18 +89,11 @@ public interface AzureQuotaExtensionApi { GroupQuotaSubscriptionAllocationRequestsClient getGroupQuotaSubscriptionAllocationRequests(); /** - * Gets the GroupQuotaUsagesClient object to access its operations. - * - * @return the GroupQuotaUsagesClient object. - */ - GroupQuotaUsagesClient getGroupQuotaUsages(); - - /** - * Gets the GroupQuotaLocationSettingsClient object to access its operations. + * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. * - * @return the GroupQuotaLocationSettingsClient object. + * @return the GroupQuotaSubscriptionAllocationsClient object. */ - GroupQuotaLocationSettingsClient getGroupQuotaLocationSettings(); + GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations(); /** * Gets the UsagesClient object to access its operations. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java index 54f07d679d1cb..2d3e8592d3c7c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java @@ -6,123 +6,50 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; /** * An instance of this class provides access to all the operations defined in GroupQuotaLimitsClient. */ public interface GroupQuotaLimitsClient { /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link Response}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter, Context context); + Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context); /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. */ @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaLimitInner get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, String filter); - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this 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 GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); + GroupQuotaLimitListInner list(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java index 26640734c033b..ec4e563d5c061 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java @@ -8,123 +8,22 @@ 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.ProxyResource; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; /** * An instance of this class provides access to all the operations defined in GroupQuotaLimitsRequestsClient. */ public interface GroupQuotaLimitsRequestsClient { - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName); - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this 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 status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context); - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName); - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this 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 status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context); - /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -133,22 +32,22 @@ ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, St * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 the {@link SyncPoller} for polling of status of a single GroupQuota request. + * @return the {@link SyncPoller} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SubmittedResourceRequestStatusInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName); + SyncPoller, GroupQuotaLimitListInner> beginUpdate(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location); /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -157,25 +56,25 @@ ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, St * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this 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 status of a single GroupQuota request. + * @return the {@link SyncPoller} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SubmittedResourceRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context); + SyncPoller, GroupQuotaLimitListInner> beginUpdate(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest, + Context context); /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -184,22 +83,22 @@ SyncPoller, SubmittedResourceReq * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.SINGLE) - SubmittedResourceRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName); + GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location); /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -208,18 +107,17 @@ SubmittedResourceRequestStatusInner update(String managementGroupId, String grou * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this 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 status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.SINGLE) - SubmittedResourceRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context); + GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location, GroupQuotaLimitListInner groupQuotaRequest, Context context); /** * Get the status of a single GroupQuota request by requestId. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java deleted file mode 100644 index 1616a67df060b..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java +++ /dev/null @@ -1,339 +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.quota.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.ProxyResource; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaLocationSettingsClient. - */ -public interface GroupQuotaLocationSettingsClient { - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementResponseInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementResponseInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementResponseInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementResponseInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementResponseInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context); - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementResponseInner get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName); - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java index 533d86da7403a..94274ef71ff50 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java @@ -8,308 +8,209 @@ 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.ProxyResource; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; /** * An instance of this class provides access to all the operations defined in * GroupQuotaSubscriptionAllocationRequestsClient. */ public interface GroupQuotaSubscriptionAllocationRequestsClient { - /** - * Get the status of the quota allocation request for the subscriptionId. - * - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String allocationId, Context context); - - /** - * Get the status of the quota allocation request for the subscriptionId. - * - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request 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 the quota allocation request status for the subscriptionId by allocationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, String allocationId); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. - * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. - * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this 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 all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); - /** * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * with 202 response and status polling API. * * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 the subscription quota allocation status. + * @return the {@link SyncPoller} for polling of subscription quota list. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest); + SyncPoller, SubscriptionQuotaAllocationsListInner> beginUpdate( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest); /** * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * with 202 response and status polling API. * * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this 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 the subscription quota allocation status. + * @return the {@link SyncPoller} for polling of subscription quota list. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context); + SyncPoller, SubscriptionQuotaAllocationsListInner> beginUpdate( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context); /** * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * with 202 response and status polling API. * * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. + * @return subscription quota list. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest); + SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest); /** * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * with 202 response and status polling API. * * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this 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 subscription quota allocation status. + * @return subscription quota list. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context); + SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context); /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the subscription quota allocation status. + * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, QuotaAllocationRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String allocationId, Context context); /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. + * @param allocationId Request 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 the {@link SyncPoller} for polling of the subscription quota allocation status. + * @return the quota allocation request status for the subscriptionId by allocationId. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, QuotaAllocationRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, String resourceProviderName, + String allocationId); /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param filter | Field | Supported operators + * |---------------------|------------------------ + * + * location eq {location} + * Example: $filter=location eq eastus. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaAllocationRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter); /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param filter | Field | Supported operators + * |---------------------|------------------------ + * + * location eq {location} + * Example: $filter=location eq eastus. * @param context The context to associate with this 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 subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaAllocationRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter, Context context); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java index 6aa718444d0a4..38f5cf64598b4 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java @@ -6,113 +6,58 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; /** * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionAllocationsClient. */ public interface GroupQuotaSubscriptionAllocationsClient { /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String filter); - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String filter, Context context); - - /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName along with - * {@link Response}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceName, String filter, Context context); + Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context); /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionQuotaAllocationsInner get(String managementGroupId, String groupQuotaName, String resourceName, - String filter); + SubscriptionQuotaAllocationsListInner list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java deleted file mode 100644 index 45e838d69824c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.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.quota.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.quota.fluent.models.ResourceUsagesInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaUsagesClient. - */ -public interface GroupQuotaUsagesClient { - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitInner.java deleted file mode 100644 index bab9f6529dc27..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitInner.java +++ /dev/null @@ -1,166 +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.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaDetails; -import java.io.IOException; - -/** - * Group Quota limit. - */ -@Fluent -public final class GroupQuotaLimitInner extends ProxyResource { - /* - * Group Quota properties for the specified resource. - */ - private GroupQuotaDetails properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of GroupQuotaLimitInner class. - */ - public GroupQuotaLimitInner() { - } - - /** - * Get the properties property: Group Quota properties for the specified resource. - * - * @return the properties value. - */ - public GroupQuotaDetails properties() { - return this.properties; - } - - /** - * Set the properties property: Group Quota properties for the specified resource. - * - * @param properties the properties value to set. - * @return the GroupQuotaLimitInner object itself. - */ - public GroupQuotaLimitInner withProperties(GroupQuotaDetails properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaLimitInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimitInner 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 GroupQuotaLimitInner. - */ - public static GroupQuotaLimitInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimitInner deserializedGroupQuotaLimitInner = new GroupQuotaLimitInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotaLimitInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaLimitInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotaLimitInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotaLimitInner.properties = GroupQuotaDetails.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotaLimitInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimitInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java similarity index 66% rename from sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java rename to sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java index ce8ba184776c0..144b286842ea7 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java @@ -10,18 +10,18 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; import java.io.IOException; /** - * Resource details with usages and GroupQuota. + * List of Group Quota Limit details. */ @Fluent -public final class ResourceUsagesInner extends ProxyResource { +public final class GroupQuotaLimitListInner extends ProxyResource { /* - * Resource details with usages and GroupQuota. + * The properties property. */ - private GroupQuotaUsagesBase properties; + private GroupQuotaLimitListProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -44,27 +44,27 @@ public final class ResourceUsagesInner extends ProxyResource { private String id; /** - * Creates an instance of ResourceUsagesInner class. + * Creates an instance of GroupQuotaLimitListInner class. */ - public ResourceUsagesInner() { + public GroupQuotaLimitListInner() { } /** - * Get the properties property: Resource details with usages and GroupQuota. + * Get the properties property: The properties property. * * @return the properties value. */ - public GroupQuotaUsagesBase properties() { + public GroupQuotaLimitListProperties properties() { return this.properties; } /** - * Set the properties property: Resource details with usages and GroupQuota. + * Set the properties property: The properties property. * * @param properties the properties value to set. - * @return the ResourceUsagesInner object itself. + * @return the GroupQuotaLimitListInner object itself. */ - public ResourceUsagesInner withProperties(GroupQuotaUsagesBase properties) { + public GroupQuotaLimitListInner withProperties(GroupQuotaLimitListProperties properties) { this.properties = properties; return this; } @@ -130,37 +130,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResourceUsagesInner from the JsonReader. + * Reads an instance of GroupQuotaLimitListInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResourceUsagesInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of GroupQuotaLimitListInner 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 ResourceUsagesInner. + * @throws IOException If an error occurs while reading the GroupQuotaLimitListInner. */ - public static ResourceUsagesInner fromJson(JsonReader jsonReader) throws IOException { + public static GroupQuotaLimitListInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResourceUsagesInner deserializedResourceUsagesInner = new ResourceUsagesInner(); + GroupQuotaLimitListInner deserializedGroupQuotaLimitListInner = new GroupQuotaLimitListInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedResourceUsagesInner.id = reader.getString(); + deserializedGroupQuotaLimitListInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedResourceUsagesInner.name = reader.getString(); + deserializedGroupQuotaLimitListInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedResourceUsagesInner.type = reader.getString(); + deserializedGroupQuotaLimitListInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedResourceUsagesInner.properties = GroupQuotaUsagesBase.fromJson(reader); + deserializedGroupQuotaLimitListInner.properties = GroupQuotaLimitListProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedResourceUsagesInner.systemData = SystemData.fromJson(reader); + deserializedGroupQuotaLimitListInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedResourceUsagesInner; + return deserializedGroupQuotaLimitListInner; }); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java deleted file mode 100644 index df895d094d8d0..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java +++ /dev/null @@ -1,110 +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.quota.fluent.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Fluent -public final class GroupQuotaUsagesBaseName implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of GroupQuotaUsagesBaseName class. - */ - public GroupQuotaUsagesBaseName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Resource name. - * - * @param value the value value to set. - * @return the GroupQuotaUsagesBaseName object itself. - */ - public GroupQuotaUsagesBaseName withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * 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(); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaUsagesBaseName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaUsagesBaseName 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 GroupQuotaUsagesBaseName. - */ - public static GroupQuotaUsagesBaseName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaUsagesBaseName deserializedGroupQuotaUsagesBaseName = new GroupQuotaUsagesBaseName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedGroupQuotaUsagesBaseName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedGroupQuotaUsagesBaseName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaUsagesBaseName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java index 2723af0efbaa1..1a1a051189a72 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java @@ -10,7 +10,7 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; import java.io.IOException; /** @@ -19,9 +19,9 @@ @Fluent public final class GroupQuotasEntityInner extends ProxyResource { /* - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. + * Properties */ - private GroupQuotasEntityBase properties; + private GroupQuotasEntityProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -50,23 +50,21 @@ public GroupQuotasEntityInner() { } /** - * Get the properties property: Properties and filters for ShareQuota. The request parameter is optional, if there - * are no filters specified. + * Get the properties property: Properties. * * @return the properties value. */ - public GroupQuotasEntityBase properties() { + public GroupQuotasEntityProperties properties() { return this.properties; } /** - * Set the properties property: Properties and filters for ShareQuota. The request parameter is optional, if there - * are no filters specified. + * Set the properties property: Properties. * * @param properties the properties value to set. * @return the GroupQuotasEntityInner object itself. */ - public GroupQuotasEntityInner withProperties(GroupQuotasEntityBase properties) { + public GroupQuotasEntityInner withProperties(GroupQuotasEntityProperties properties) { this.properties = properties; return this; } @@ -154,7 +152,7 @@ public static GroupQuotasEntityInner fromJson(JsonReader jsonReader) throws IOEx } else if ("type".equals(fieldName)) { deserializedGroupQuotasEntityInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEntityInner.properties = GroupQuotasEntityBase.fromJson(reader); + deserializedGroupQuotasEntityInner.properties = GroupQuotasEntityProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedGroupQuotasEntityInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsInner.java deleted file mode 100644 index dcd7811492253..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsInner.java +++ /dev/null @@ -1,170 +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.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaDetails; -import java.io.IOException; - -/** - * Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the - * GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be - * allocated back to the MG Group Quota. - */ -@Fluent -public final class SubscriptionQuotaAllocationsInner extends ProxyResource { - /* - * Quota properties for the specified resource. - */ - private SubscriptionQuotaDetails properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SubscriptionQuotaAllocationsInner class. - */ - public SubscriptionQuotaAllocationsInner() { - } - - /** - * Get the properties property: Quota properties for the specified resource. - * - * @return the properties value. - */ - public SubscriptionQuotaDetails properties() { - return this.properties; - } - - /** - * Set the properties property: Quota properties for the specified resource. - * - * @param properties the properties value to set. - * @return the SubscriptionQuotaAllocationsInner object itself. - */ - public SubscriptionQuotaAllocationsInner withProperties(SubscriptionQuotaDetails properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaAllocationsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocationsInner 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 SubscriptionQuotaAllocationsInner. - */ - public static SubscriptionQuotaAllocationsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocationsInner deserializedSubscriptionQuotaAllocationsInner - = new SubscriptionQuotaAllocationsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsInner.properties - = SubscriptionQuotaDetails.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocationsInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementResponseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java similarity index 66% rename from sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementResponseInner.java rename to sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java index 944dafb7735c9..99bc7270d5dbf 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementResponseInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java @@ -10,18 +10,18 @@ import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; import java.io.IOException; /** - * The GroupQuota Enforcement status for a Azure Location/Region. + * Subscription quota list. */ @Fluent -public final class GroupQuotasEnforcementResponseInner extends ProxyResource { +public final class SubscriptionQuotaAllocationsListInner extends ProxyResource { /* * The properties property. */ - private GroupQuotasEnforcementResponseProperties properties; + private SubscriptionQuotaAllocationsListProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -44,9 +44,9 @@ public final class GroupQuotasEnforcementResponseInner extends ProxyResource { private String id; /** - * Creates an instance of GroupQuotasEnforcementResponseInner class. + * Creates an instance of SubscriptionQuotaAllocationsListInner class. */ - public GroupQuotasEnforcementResponseInner() { + public SubscriptionQuotaAllocationsListInner() { } /** @@ -54,7 +54,7 @@ public GroupQuotasEnforcementResponseInner() { * * @return the properties value. */ - public GroupQuotasEnforcementResponseProperties properties() { + public SubscriptionQuotaAllocationsListProperties properties() { return this.properties; } @@ -62,9 +62,9 @@ public GroupQuotasEnforcementResponseProperties properties() { * Set the properties property: The properties property. * * @param properties the properties value to set. - * @return the GroupQuotasEnforcementResponseInner object itself. + * @return the SubscriptionQuotaAllocationsListInner object itself. */ - public GroupQuotasEnforcementResponseInner withProperties(GroupQuotasEnforcementResponseProperties properties) { + public SubscriptionQuotaAllocationsListInner withProperties(SubscriptionQuotaAllocationsListProperties properties) { this.properties = properties; return this; } @@ -130,39 +130,39 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of GroupQuotasEnforcementResponseInner from the JsonReader. + * Reads an instance of SubscriptionQuotaAllocationsListInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEnforcementResponseInner if the JsonReader was pointing to an instance of it, + * @return An instance of SubscriptionQuotaAllocationsListInner 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 GroupQuotasEnforcementResponseInner. + * @throws IOException If an error occurs while reading the SubscriptionQuotaAllocationsListInner. */ - public static GroupQuotasEnforcementResponseInner fromJson(JsonReader jsonReader) throws IOException { + public static SubscriptionQuotaAllocationsListInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - GroupQuotasEnforcementResponseInner deserializedGroupQuotasEnforcementResponseInner - = new GroupQuotasEnforcementResponseInner(); + SubscriptionQuotaAllocationsListInner deserializedSubscriptionQuotaAllocationsListInner + = new SubscriptionQuotaAllocationsListInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseInner.id = reader.getString(); + deserializedSubscriptionQuotaAllocationsListInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseInner.name = reader.getString(); + deserializedSubscriptionQuotaAllocationsListInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseInner.type = reader.getString(); + deserializedSubscriptionQuotaAllocationsListInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseInner.properties - = GroupQuotasEnforcementResponseProperties.fromJson(reader); + deserializedSubscriptionQuotaAllocationsListInner.properties + = SubscriptionQuotaAllocationsListProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseInner.systemData = SystemData.fromJson(reader); + deserializedSubscriptionQuotaAllocationsListInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedGroupQuotasEnforcementResponseInner; + return deserializedSubscriptionQuotaAllocationsListInner; }); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java index 7109619c4e87e..fc61bec422fde 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java @@ -26,12 +26,10 @@ import com.azure.resourcemanager.quota.fluent.AzureQuotaExtensionApi; import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLocationSettingsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionRequestsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaUsagesClient; import com.azure.resourcemanager.quota.fluent.GroupQuotasClient; import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient; import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient; @@ -177,20 +175,6 @@ public GroupQuotaSubscriptionRequestsClient getGroupQuotaSubscriptionRequests() return this.groupQuotaSubscriptionRequests; } - /** - * The GroupQuotaLimitsClient object to access its operations. - */ - private final GroupQuotaLimitsClient groupQuotaLimits; - - /** - * Gets the GroupQuotaLimitsClient object to access its operations. - * - * @return the GroupQuotaLimitsClient object. - */ - public GroupQuotaLimitsClient getGroupQuotaLimits() { - return this.groupQuotaLimits; - } - /** * The GroupQuotaLimitsRequestsClient object to access its operations. */ @@ -206,17 +190,17 @@ public GroupQuotaLimitsRequestsClient getGroupQuotaLimitsRequests() { } /** - * The GroupQuotaSubscriptionAllocationsClient object to access its operations. + * The GroupQuotaLimitsClient object to access its operations. */ - private final GroupQuotaSubscriptionAllocationsClient groupQuotaSubscriptionAllocations; + private final GroupQuotaLimitsClient groupQuotaLimits; /** - * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. + * Gets the GroupQuotaLimitsClient object to access its operations. * - * @return the GroupQuotaSubscriptionAllocationsClient object. + * @return the GroupQuotaLimitsClient object. */ - public GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations() { - return this.groupQuotaSubscriptionAllocations; + public GroupQuotaLimitsClient getGroupQuotaLimits() { + return this.groupQuotaLimits; } /** @@ -234,31 +218,17 @@ public GroupQuotaSubscriptionAllocationRequestsClient getGroupQuotaSubscriptionA } /** - * The GroupQuotaUsagesClient object to access its operations. - */ - private final GroupQuotaUsagesClient groupQuotaUsages; - - /** - * Gets the GroupQuotaUsagesClient object to access its operations. - * - * @return the GroupQuotaUsagesClient object. - */ - public GroupQuotaUsagesClient getGroupQuotaUsages() { - return this.groupQuotaUsages; - } - - /** - * The GroupQuotaLocationSettingsClient object to access its operations. + * The GroupQuotaSubscriptionAllocationsClient object to access its operations. */ - private final GroupQuotaLocationSettingsClient groupQuotaLocationSettings; + private final GroupQuotaSubscriptionAllocationsClient groupQuotaSubscriptionAllocations; /** - * Gets the GroupQuotaLocationSettingsClient object to access its operations. + * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. * - * @return the GroupQuotaLocationSettingsClient object. + * @return the GroupQuotaSubscriptionAllocationsClient object. */ - public GroupQuotaLocationSettingsClient getGroupQuotaLocationSettings() { - return this.groupQuotaLocationSettings; + public GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations() { + return this.groupQuotaSubscriptionAllocations; } /** @@ -334,16 +304,14 @@ public QuotaOperationsClient getQuotaOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-06-01-preview"; + this.apiVersion = "2024-12-12"; this.groupQuotas = new GroupQuotasClientImpl(this); this.groupQuotaSubscriptions = new GroupQuotaSubscriptionsClientImpl(this); this.groupQuotaSubscriptionRequests = new GroupQuotaSubscriptionRequestsClientImpl(this); - this.groupQuotaLimits = new GroupQuotaLimitsClientImpl(this); this.groupQuotaLimitsRequests = new GroupQuotaLimitsRequestsClientImpl(this); - this.groupQuotaSubscriptionAllocations = new GroupQuotaSubscriptionAllocationsClientImpl(this); + this.groupQuotaLimits = new GroupQuotaLimitsClientImpl(this); this.groupQuotaSubscriptionAllocationRequests = new GroupQuotaSubscriptionAllocationRequestsClientImpl(this); - this.groupQuotaUsages = new GroupQuotaUsagesClientImpl(this); - this.groupQuotaLocationSettings = new GroupQuotaLocationSettingsClientImpl(this); + this.groupQuotaSubscriptionAllocations = new GroupQuotaSubscriptionAllocationsClientImpl(this); this.usages = new UsagesClientImpl(this); this.quotas = new QuotasClientImpl(this); this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java similarity index 65% rename from sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitImpl.java rename to sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java index bd8ac2a0f09dc..01bcc6bcbcf7b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java @@ -5,16 +5,17 @@ package com.azure.resourcemanager.quota.implementation; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import com.azure.resourcemanager.quota.models.GroupQuotaDetails; -import com.azure.resourcemanager.quota.models.GroupQuotaLimit; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; -public final class GroupQuotaLimitImpl implements GroupQuotaLimit { - private GroupQuotaLimitInner innerObject; +public final class GroupQuotaLimitListImpl implements GroupQuotaLimitList { + private GroupQuotaLimitListInner innerObject; private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - GroupQuotaLimitImpl(GroupQuotaLimitInner innerObject, com.azure.resourcemanager.quota.QuotaManager serviceManager) { + GroupQuotaLimitListImpl(GroupQuotaLimitListInner innerObject, + com.azure.resourcemanager.quota.QuotaManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +32,7 @@ public String type() { return this.innerModel().type(); } - public GroupQuotaDetails properties() { + public GroupQuotaLimitListProperties properties() { return this.innerModel().properties(); } @@ -39,7 +40,7 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public GroupQuotaLimitInner innerModel() { + public GroupQuotaLimitListInner innerModel() { return this.innerObject; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java index 97c9435025fe8..32f9a9a0e7991 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java @@ -16,18 +16,13 @@ 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.resourcemanager.quota.fluent.GroupQuotaLimitsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; import reactor.core.publisher.Mono; /** @@ -63,63 +58,34 @@ public final class GroupQuotaLimitsClientImpl implements GroupQuotaLimitsClient @ServiceInterface(name = "AzureQuotaExtensionA") public interface GroupQuotaLimitsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{resourceName}") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link Response} on successful completion of {@link Mono}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter) { + private Mono> listWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -135,48 +101,35 @@ private Mono> getWithResponseAsync(String managem return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.get(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, resourceName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), managementGroupId, groupQuotaName, + resourceProviderName, location, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link Response} on successful completion of {@link Mono}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter, Context context) { + private Mono> listWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -192,387 +145,79 @@ private Mono> getWithResponseAsync(String managem return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.get(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, - resourceName, this.client.getApiVersion(), filter, accept, context); + return service.list(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, + location, this.client.getApiVersion(), accept, context); } /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota on successful completion - * of {@link Mono}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, filter) + private Mono listAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location) { + return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter, Context context) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, filter, - context).block(); - } - - /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaLimitInner get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, String filter) { - return getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, resourceName, filter, - Context.NONE).getValue(); - } - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, this.client.getApiVersion(), filter, 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())); + public Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context) { + return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location, context) + .block(); } /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. + * @param location The name of the 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 the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, - this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter)); - } - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, 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 Group Quota Limit details 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Group Quota Limit details along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public GroupQuotaLimitListInner list(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location) { + return listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) + .getValue(); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java index 8fc70a38820e7..3b14b090e101e 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java @@ -4,14 +4,13 @@ package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaLimitsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLimit; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; import com.azure.resourcemanager.quota.models.GroupQuotaLimits; public final class GroupQuotaLimitsImpl implements GroupQuotaLimits { @@ -27,43 +26,29 @@ public GroupQuotaLimitsImpl(GroupQuotaLimitsClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter, Context context) { - Response inner = this.serviceClient() - .getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, resourceName, filter, context); + public Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context) { + Response inner = this.serviceClient() + .listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotaLimitImpl(inner.getValue(), this.manager())); + new GroupQuotaLimitListImpl(inner.getValue(), this.manager())); } else { return null; } } - public GroupQuotaLimit get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, String filter) { - GroupQuotaLimitInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, resourceProviderName, resourceName, filter); + public GroupQuotaLimitList list(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location) { + GroupQuotaLimitListInner inner + = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); if (inner != null) { - return new GroupQuotaLimitImpl(inner, this.manager()); + return new GroupQuotaLimitListImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotaLimitImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotaLimitImpl(inner1, this.manager())); - } - private GroupQuotaLimitsClient serviceClient() { return this.innerClient; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java index 783e76dc84a51..5129963836d49 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java @@ -13,7 +13,6 @@ 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; @@ -25,7 +24,6 @@ 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.ProxyResource; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; @@ -33,6 +31,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatusList; import java.nio.ByteBuffer; @@ -72,27 +71,15 @@ public final class GroupQuotaLimitsRequestsClientImpl implements GroupQuotaLimit @ServiceInterface(name = "AzureQuotaExtensionA") public interface GroupQuotaLimitsRequestsService { @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SubmittedResourceRequestStatusInner groupQuotaRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}") + @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SubmittedResourceRequestStatusInner groupQuotaRequest, + @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GroupQuotaLimitListInner groupQuotaRequest, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -124,419 +111,12 @@ Mono> listNext( @HeaderParam("Accept") String accept, Context context); } - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (groupQuotaRequest != null) { - groupQuotaRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, resourceName, this.client.getApiVersion(), groupQuotaRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (groupQuotaRequest != null) { - groupQuotaRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, resourceName, this.client.getApiVersion(), groupQuotaRequest, accept, context); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest) { - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, this.client.getContext()); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, this.client.getContext()); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, context); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest) - .getSyncPoller(); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest, context) - .getSyncPoller(); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest).block(); - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest, context).block(); - } - /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -545,17 +125,16 @@ public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaN * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of Group Quota Limit details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest) { + String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -571,8 +150,8 @@ private Mono>> updateWithResponseAsync(String manageme return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (groupQuotaRequest != null) { groupQuotaRequest.validate(); @@ -580,16 +159,16 @@ private Mono>> updateWithResponseAsync(String manageme final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, resourceName, this.client.getApiVersion(), groupQuotaRequest, accept, context)) + resourceProviderName, location, this.client.getApiVersion(), groupQuotaRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -598,19 +177,17 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of Group Quota Limit details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context) { + String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -626,8 +203,8 @@ private Mono>> updateWithResponseAsync(String manageme return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (groupQuotaRequest != null) { groupQuotaRequest.validate(); @@ -635,15 +212,15 @@ private Mono>> updateWithResponseAsync(String manageme final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, - resourceName, this.client.getApiVersion(), groupQuotaRequest, accept, context); + location, this.client.getApiVersion(), groupQuotaRequest, accept, context); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -652,30 +229,30 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 status of a single GroupQuota request. + * @return the {@link PollerFlux} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SubmittedResourceRequestStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest) { + private PollerFlux, GroupQuotaLimitListInner> beginUpdateAsync( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + GroupQuotaLimitListInner groupQuotaRequest) { Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SubmittedResourceRequestStatusInner.class, - SubmittedResourceRequestStatusInner.class, this.client.getContext()); + resourceProviderName, location, groupQuotaRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, + this.client.getContext()); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -684,30 +261,29 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 the {@link PollerFlux} for polling of status of a single GroupQuota request. + * @return the {@link PollerFlux} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SubmittedResourceRequestStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; + private PollerFlux, GroupQuotaLimitListInner> beginUpdateAsync( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { + final GroupQuotaLimitListInner groupQuotaRequest = null; Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SubmittedResourceRequestStatusInner.class, - SubmittedResourceRequestStatusInner.class, this.client.getContext()); + resourceProviderName, location, groupQuotaRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, + this.client.getContext()); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -716,32 +292,31 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 status of a single GroupQuota request. + * @return the {@link PollerFlux} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SubmittedResourceRequestStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { + private PollerFlux, GroupQuotaLimitListInner> beginUpdateAsync( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + GroupQuotaLimitListInner groupQuotaRequest, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, groupQuotaRequest, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SubmittedResourceRequestStatusInner.class, - SubmittedResourceRequestStatusInner.class, context); + resourceProviderName, location, groupQuotaRequest, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, context); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -750,27 +325,27 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 the {@link SyncPoller} for polling of status of a single GroupQuota request. + * @return the {@link SyncPoller} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SubmittedResourceRequestStatusInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; + public SyncPoller, GroupQuotaLimitListInner> + beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { + final GroupQuotaLimitListInner groupQuotaRequest = null; return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest) + .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) .getSyncPoller(); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -779,20 +354,20 @@ private Mono>> updateWithResponseAsync(String manageme * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 status of a single GroupQuota request. + * @return the {@link SyncPoller} for polling of list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SubmittedResourceRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { + public SyncPoller, GroupQuotaLimitListInner> beginUpdate( + String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + GroupQuotaLimitListInner groupQuotaRequest, Context context) { return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest, + .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, context) .getSyncPoller(); } @@ -800,9 +375,9 @@ public SyncPoller, SubmittedReso /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -811,26 +386,27 @@ public SyncPoller, SubmittedReso * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request on successful completion of {@link Mono}. + * @return list of Group Quota Limit details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest) { + return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -839,26 +415,27 @@ private Mono updateAsync(String managementG * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 status of a single GroupQuota request on successful completion of {@link Mono}. + * @return list of Group Quota Limit details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location) { + final GroupQuotaLimitListInner groupQuotaRequest = null; + return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -867,28 +444,27 @@ private Mono updateAsync(String managementG * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request on successful completion of {@link Mono}. + * @return list of Group Quota Limit details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - groupQuotaRequest, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { + return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -897,26 +473,26 @@ private Mono updateAsync(String managementG * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SubmittedResourceRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName) { - final SubmittedResourceRequestStatusInner groupQuotaRequest = null; - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest) + public GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location) { + final GroupQuotaLimitListInner groupQuotaRequest = null; + return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) .block(); } /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -925,19 +501,18 @@ public SubmittedResourceRequestStatusInner update(String managementGroupId, Stri * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SubmittedResourceRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context) { - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest, + public GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { + return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, context).block(); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java index e6af14e9daaaf..6edd2fb4b4ef2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java @@ -7,11 +7,12 @@ 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.management.ProxyResource; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; import com.azure.resourcemanager.quota.models.GroupQuotaLimitsRequests; import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatus; @@ -28,37 +29,23 @@ public GroupQuotaLimitsRequestsImpl(GroupQuotaLimitsRequestsClient innerClient, this.serviceManager = serviceManager; } - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName) { - return this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, resourceName); - } - - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context) { - return this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest, - context); - } - - public SubmittedResourceRequestStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName) { - SubmittedResourceRequestStatusInner inner - = this.serviceClient().update(managementGroupId, groupQuotaName, resourceProviderName, resourceName); + public GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location) { + GroupQuotaLimitListInner inner + = this.serviceClient().update(managementGroupId, groupQuotaName, resourceProviderName, location); if (inner != null) { - return new SubmittedResourceRequestStatusImpl(inner, this.manager()); + return new GroupQuotaLimitListImpl(inner, this.manager()); } else { return null; } } - public SubmittedResourceRequestStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, - Context context) { - SubmittedResourceRequestStatusInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, resourceName, groupQuotaRequest, context); + public GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { + GroupQuotaLimitListInner inner = this.serviceClient() + .update(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, context); if (inner != null) { - return new SubmittedResourceRequestStatusImpl(inner, this.manager()); + return new GroupQuotaLimitListImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java deleted file mode 100644 index 7f58c00b99827..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java +++ /dev/null @@ -1,1440 +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.quota.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.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.ProxyResource; -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.quota.fluent.GroupQuotaLocationSettingsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementListResponse; -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 GroupQuotaLocationSettingsClient. - */ -public final class GroupQuotaLocationSettingsClientImpl implements GroupQuotaLocationSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaLocationSettingsService service; - - /** - * The service client containing this operation class. - */ - private final AzureQuotaExtensionApiImpl client; - - /** - * Initializes an instance of GroupQuotaLocationSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaLocationSettingsClientImpl(AzureQuotaExtensionApiImpl client) { - this.service = RestProxy.create(GroupQuotaLocationSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureQuotaExtensionApiGroupQuotaLocationSettings to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuotaExtensionA") - public interface GroupQuotaLocationSettingsService { - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GroupQuotasEnforcementResponseInner locationSettings, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GroupQuotasEnforcementResponseInner locationSettings, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (locationSettings != null) { - locationSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, location, this.client.getApiVersion(), locationSettings, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (locationSettings != null) { - locationSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, location, this.client.getApiVersion(), locationSettings, accept, context); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings) { - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link PollerFlux} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, context); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings) - .getSyncPoller(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context) { - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings, context) - .getSyncPoller(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .block(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementResponseInner locationSettings, Context context) { - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context).block(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (locationSettings != null) { - locationSettings.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, location, this.client.getApiVersion(), locationSettings, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (locationSettings != null) { - locationSettings.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, - location, this.client.getApiVersion(), locationSettings, accept, context); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementResponseInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementResponseInner.class, - GroupQuotasEnforcementResponseInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link PollerFlux} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementResponseInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementResponseInner.class, - GroupQuotasEnforcementResponseInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementResponseInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementResponseInner.class, - GroupQuotasEnforcementResponseInner.class, context); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementResponseInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .getSyncPoller(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementResponseInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementResponseInner locationSettings, Context context) { - return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context) - .getSyncPoller(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementResponseInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementResponseInner locationSettings = null; - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings).block(); - } - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementResponseInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context) { - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, context) - .block(); - } - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName 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.get(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, location, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, 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 (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName 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.get(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, location, - this.client.getApiVersion(), accept, context); - } - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, Context context) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location, context).block(); - } - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementResponseInner get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) - .getValue(); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName)); - } - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, Context context) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, 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 Azure regions, where the group quotas is enabled for enforcement 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Azure regions, where the group quotas is enabled for enforcement along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java deleted file mode 100644 index 7a9a6908d8839..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java +++ /dev/null @@ -1,112 +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.quota.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.management.ProxyResource; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLocationSettingsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLocationSettings; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponse; - -public final class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSettings { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaLocationSettingsImpl.class); - - private final GroupQuotaLocationSettingsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaLocationSettingsImpl(GroupQuotaLocationSettingsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - return this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location); - } - - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementResponseInner locationSettings, Context context) { - return this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context); - } - - public GroupQuotasEnforcementResponse update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - GroupQuotasEnforcementResponseInner inner - = this.serviceClient().update(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotasEnforcementResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEnforcementResponse update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementResponseInner locationSettings, - Context context) { - GroupQuotasEnforcementResponseInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, context); - if (inner != null) { - return new GroupQuotasEnforcementResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - Response inner = this.serviceClient() - .getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotasEnforcementResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GroupQuotasEnforcementResponse get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - GroupQuotasEnforcementResponseInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotasEnforcementResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new GroupQuotasEnforcementResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new GroupQuotasEnforcementResponseImpl(inner1, this.manager())); - } - - private GroupQuotaLocationSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java index 36587b3a786de..0ec77f277a5d4 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java @@ -13,7 +13,6 @@ 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; @@ -25,7 +24,6 @@ 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.ProxyResource; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; @@ -34,6 +32,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; import com.azure.resourcemanager.quota.models.QuotaAllocationRequestStatusList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -74,48 +73,37 @@ public final class GroupQuotaSubscriptionAllocationRequestsClientImpl @ServiceInterface(name = "AzureQuotaExtensionA") public interface GroupQuotaSubscriptionAllocationRequestsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocationRequests/{allocationId}") - @ExpectedResponses({ 200 }) + @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("allocationId") String allocationId, @QueryParam("api-version") String apiVersion, + @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SubscriptionQuotaAllocationsListInner allocateQuotaRequest, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{allocationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") QuotaAllocationRequestStatusInner allocateQuotaRequest, + @PathParam("allocationId") String allocationId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}") - @ExpectedResponses({ 200, 202 }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") QuotaAllocationRequestStatusInner allocateQuotaRequest, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -128,22 +116,29 @@ Mono> listNext( } /** - * Get the status of the quota allocation request for the subscriptionId. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get the quota allocation request status for the subscriptionId by allocationId. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response} on - * successful completion of {@link Mono}. + * @return subscription quota list along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String allocationId) { + private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -159,35 +154,53 @@ private Mono> getWithResponseAsync(S if (groupQuotaName == null) { return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); } - if (allocationId == null) { - return Mono.error(new IllegalArgumentException("Parameter allocationId is required and cannot be null.")); + if (resourceProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (allocateQuotaRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); + } else { + allocateQuotaRequest.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, allocationId, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), managementGroupId, + this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, + this.client.getApiVersion(), allocateQuotaRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the status of the quota allocation request for the subscriptionId. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get the quota allocation request status for the subscriptionId by allocationId. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response} on - * successful completion of {@link Mono}. + * @return subscription quota list along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String allocationId, Context context) { + private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -203,326 +216,290 @@ private Mono> getWithResponseAsync(S if (groupQuotaName == null) { return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); } - if (allocationId == null) { - return Mono.error(new IllegalArgumentException("Parameter allocationId is required and cannot be null.")); + if (resourceProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (allocateQuotaRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); + } else { + allocateQuotaRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, allocationId, this.client.getApiVersion(), accept, context); + return service.update(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, location, this.client.getApiVersion(), allocateQuotaRequest, accept, + context); } /** - * Get the status of the quota allocation request for the subscriptionId. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get the quota allocation request status for the subscriptionId by allocationId. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of subscription quota list. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String allocationId) { - return getWithResponseAsync(managementGroupId, groupQuotaName, allocationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SubscriptionQuotaAllocationsListInner> + beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { + Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, + resourceProviderName, location, allocateQuotaRequest); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SubscriptionQuotaAllocationsListInner.class, + SubscriptionQuotaAllocationsListInner.class, this.client.getContext()); } /** - * Get the status of the quota allocation request for the subscriptionId. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get the quota allocation request status for the subscriptionId by allocationId. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response}. + * @return the {@link PollerFlux} for polling of subscription quota list. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String allocationId, Context context) { - return getWithResponseAsync(managementGroupId, groupQuotaName, allocationId, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SubscriptionQuotaAllocationsListInner> + beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, + resourceProviderName, location, allocateQuotaRequest, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), SubscriptionQuotaAllocationsListInner.class, + SubscriptionQuotaAllocationsListInner.class, context); } /** - * Get the status of the quota allocation request for the subscriptionId. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get the quota allocation request status for the subscriptionId by allocationId. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param allocationId Request Id. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota allocation request status for the subscriptionId by allocationId. + * @return the {@link SyncPoller} for polling of subscription quota list. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, String allocationId) { - return getWithResponse(managementGroupId, groupQuotaName, allocationId, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubscriptionQuotaAllocationsListInner> + beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { + return this + .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest) + .getSyncPoller(); } /** - * Get all the quotaAllocationRequests for a resourceProvider/location. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of subscription quota list. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, resourceProviderName, this.client.getApiVersion(), filter, 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())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SubscriptionQuotaAllocationsListInner> + beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, + SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context) { + return this + .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, + context) + .getSyncPoller(); } /** - * Get all the quotaAllocationRequests for a resourceProvider/location. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return subscription quota list on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), groupQuotaName, - resourceProviderName, this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono updateAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { + return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get all the quotaAllocationRequests for a resourceProvider/location. - * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. - * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedFlux}. + * @return subscription quota list on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context) { + return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Get all the quotaAllocationRequests for a resourceProvider/location. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. + * @return subscription quota list. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { + return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest) + .block(); } /** - * Get all the quotaAllocationRequests for a resourceProvider/location. + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. * - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. + * @return subscription quota list. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context) { + return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, + context).block(); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status along with {@link Response} on successful completion of - * {@link Mono}. + * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest) { + private Mono> getWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String allocationId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -542,50 +519,37 @@ private Mono>> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (allocateQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); - } else { - allocateQuotaRequest.validate(); + if (allocationId == null) { + return Mono.error(new IllegalArgumentException("Parameter allocationId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, resourceName, - this.client.getApiVersion(), allocateQuotaRequest, accept, context)) + .withContext( + context -> service.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, allocationId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status along with {@link Response} on successful completion of - * {@link Mono}. + * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { + private Mono> getWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String allocationId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -605,352 +569,164 @@ private Mono>> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (allocateQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); - } else { - allocateQuotaRequest.validate(); + if (allocationId == null) { + return Mono.error(new IllegalArgumentException("Parameter allocationId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, resourceProviderName, resourceName, this.client.getApiVersion(), allocateQuotaRequest, - accept, context); + return service.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, allocationId, this.client.getApiVersion(), accept, context); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the subscription quota allocation status. + * @return the quota allocation request status for the subscriptionId by allocationId on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest) { - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, allocateQuotaRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String allocationId) { + return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, allocationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the subscription quota allocation status. + * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProxyResource> beginCreateOrUpdateAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, allocateQuotaRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProxyResource.class, ProxyResource.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String allocationId, Context context) { + return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, allocationId, context) + .block(); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get the status of the quota allocation request for the subscriptionId. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get the quota allocation request status for the subscriptionId by allocationId. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the subscription quota allocation status. + * @return the quota allocation request status for the subscriptionId by allocationId. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, + String resourceProviderName, String allocationId) { + return getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, allocationId, Context.NONE) + .getValue(); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. + * @param filter | Field | Supported operators + * |---------------------|------------------------ + * + * location eq {location} + * Example: $filter=location eq eastus. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProxyResource> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - return this - .beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (groupQuotaName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); + } + if (resourceProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); + } + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, this.client.getApiVersion(), filter, 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())); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param filter | Field | Supported operators + * |---------------------|------------------------ + * + * location eq {location} + * Example: $filter=location eq eastus. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status on successful completion of {@link Mono}. + * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest).block(); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - return createOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest, context).block(); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (allocateQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); - } else { - allocateQuotaRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, resourceName, - this.client.getApiVersion(), allocateQuotaRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context) { + private Mono> listSinglePageAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -970,265 +746,130 @@ private Mono>> updateWithResponseAsync(String manageme return Mono .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (allocateQuotaRequest == null) { - return Mono - .error(new IllegalArgumentException("Parameter allocateQuotaRequest is required and cannot be null.")); - } else { - allocateQuotaRequest.validate(); + if (filter == null) { + return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, resourceProviderName, resourceName, this.client.getApiVersion(), allocateQuotaRequest, - accept, context); + return service + .list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), groupQuotaName, + resourceProviderName, this.client.getApiVersion(), filter, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the subscription quota allocation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, QuotaAllocationRequestStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, allocateQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), QuotaAllocationRequestStatusInner.class, - QuotaAllocationRequestStatusInner.class, this.client.getContext()); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * @param filter | Field | Supported operators + * |---------------------|------------------------ * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. + * location eq {location} + * Example: $filter=location eq eastus. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, QuotaAllocationRequestStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, resourceName, allocateQuotaRequest, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), QuotaAllocationRequestStatusInner.class, - QuotaAllocationRequestStatusInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 the subscription quota allocation status. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, QuotaAllocationRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest) - .getSyncPoller(); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * @param filter | Field | Supported operators + * |---------------------|------------------------ * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * location eq {location} + * Example: $filter=location eq eastus. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 the subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, QuotaAllocationRequestStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String resourceName, - QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - return this - .beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * @param filter | Field | Supported operators + * |---------------------|------------------------ * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. + * location eq {location} + * Example: $filter=location eq eastus. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status on successful completion of {@link Mono}. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest, context).last().flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter) { + return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter)); } /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. + * Get all the quotaAllocationRequests for a resourceProvider/location. * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is + * required. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaAllocationRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, allocateQuotaRequest) - .block(); - } - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * @param filter | Field | Supported operators + * |---------------------|------------------------ * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * location eq {location} + * Example: $filter=location eq eastus. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. + * @return all the quotaAllocationRequests for a resourceProvider/location as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaAllocationRequestStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context) { - return updateAsync(managementGroupId, groupQuotaName, resourceProviderName, resourceName, allocateQuotaRequest, - context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String filter, Context context) { + return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, filter, context)); } /** diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java index 797791c0bd47d..3ccb583a7c424 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java @@ -7,13 +7,14 @@ 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.management.ProxyResource; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocationRequests; import com.azure.resourcemanager.quota.models.QuotaAllocationRequestStatus; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; public final class GroupQuotaSubscriptionAllocationRequestsImpl implements GroupQuotaSubscriptionAllocationRequests { private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionAllocationRequestsImpl.class); @@ -28,10 +29,33 @@ public GroupQuotaSubscriptionAllocationRequestsImpl(GroupQuotaSubscriptionAlloca this.serviceManager = serviceManager; } + public SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { + SubscriptionQuotaAllocationsListInner inner = this.serviceClient() + .update(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest); + if (inner != null) { + return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); + } else { + return null; + } + } + + public SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context) { + SubscriptionQuotaAllocationsListInner inner = this.serviceClient() + .update(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, context); + if (inner != null) { + return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); + } else { + return null; + } + } + public Response getWithResponse(String managementGroupId, String groupQuotaName, - String allocationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, allocationId, context); + String resourceProviderName, String allocationId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, allocationId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new QuotaAllocationRequestStatusImpl(inner.getValue(), this.manager())); @@ -40,9 +64,10 @@ public Response getWithResponse(String managementG } } - public QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, String allocationId) { + public QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, + String resourceProviderName, String allocationId) { QuotaAllocationRequestStatusInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, allocationId); + = this.serviceClient().get(managementGroupId, groupQuotaName, resourceProviderName, allocationId); if (inner != null) { return new QuotaAllocationRequestStatusImpl(inner, this.manager()); } else { @@ -66,44 +91,6 @@ public PagedIterable list(String managementGroupId inner1 -> new QuotaAllocationRequestStatusImpl(inner1, this.manager())); } - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - return this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, resourceName, - allocateQuotaRequest); - } - - public ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context) { - return this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, resourceName, allocateQuotaRequest, - context); - } - - public QuotaAllocationRequestStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest) { - QuotaAllocationRequestStatusInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, resourceName, allocateQuotaRequest); - if (inner != null) { - return new QuotaAllocationRequestStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public QuotaAllocationRequestStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, - Context context) { - QuotaAllocationRequestStatusInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, resourceName, allocateQuotaRequest, - context); - if (inner != null) { - return new QuotaAllocationRequestStatusImpl(inner, this.manager()); - } else { - return null; - } - } - private GroupQuotaSubscriptionAllocationRequestsClient serviceClient() { return this.innerClient; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java index e95269c5038b4..c3c15ea3a12cd 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java @@ -16,18 +16,13 @@ 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.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationsClient; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; import reactor.core.publisher.Mono; /** @@ -63,58 +58,39 @@ public final class GroupQuotaSubscriptionAllocationsClientImpl implements GroupQ @ServiceInterface(name = "AzureQuotaExtensionA") public interface GroupQuotaSubscriptionAllocationsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 all the quota allocated to a subscription for the specific Resource Provider, Location along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String filter) { + private Mono> listWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -130,260 +106,45 @@ private Mono> listSinglePageAsy if (groupQuotaName == null) { return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, this.client.getApiVersion(), filter, 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())); - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), groupQuotaName, - this.client.getApiVersion(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, groupQuotaName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, groupQuotaName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String filter) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, filter)); - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String filter, Context context) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, filter, context)); - } - - /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota allocated to a subscription for the specific Resource Provider, Location, ResourceName along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { + if (resourceProviderName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, resourceName, this.client.getApiVersion(), filter, accept, context)) + context -> service.list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, location, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName along with - * {@link Response} on successful completion of {@link Mono}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceName, String filter, Context context) { + private Mono> listWithResponseAsync(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -399,149 +160,95 @@ private Mono> getWithResponseAsync(S if (groupQuotaName == null) { return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceProviderName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceProviderName is required and cannot be null.")); } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.get(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), - groupQuotaName, resourceName, this.client.getApiVersion(), filter, accept, context); + return service.list(this.client.getEndpoint(), managementGroupId, this.client.getSubscriptionId(), + groupQuotaName, resourceProviderName, location, this.client.getApiVersion(), accept, context); } /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName on - * successful completion of {@link Mono}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String resourceName, String filter) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceName, filter) + private Mono listAsync(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location) { + return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName along with - * {@link Response}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceName, String filter, Context context) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceName, filter, context).block(); + public Response listWithResponse(String managementGroupId, + String groupQuotaName, String resourceProviderName, String location, Context context) { + return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location, context) + .block(); } /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionQuotaAllocationsInner get(String managementGroupId, String groupQuotaName, String resourceName, - String filter) { - return getWithResponse(managementGroupId, groupQuotaName, resourceName, filter, Context.NONE).getValue(); - } - - /** - * 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 subscription quota list 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. - * @param context The context to associate with this operation. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 subscription quota list along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public SubscriptionQuotaAllocationsListInner list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location) { + return listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) + .getValue(); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java index c38015940147c..039f544978dda 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaSubscriptionAllocationsClient; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocations; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; public final class GroupQuotaSubscriptionAllocationsImpl implements GroupQuotaSubscriptionAllocations { private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionAllocationsImpl.class); @@ -27,40 +26,24 @@ public GroupQuotaSubscriptionAllocationsImpl(GroupQuotaSubscriptionAllocationsCl this.serviceManager = serviceManager; } - public PagedIterable list(String managementGroupId, String groupQuotaName, - String filter) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, filter); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SubscriptionQuotaAllocationsImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SubscriptionQuotaAllocationsImpl(inner1, this.manager())); - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceName, String filter, Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, resourceName, filter, context); + public Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context) { + Response inner = this.serviceClient() + .listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SubscriptionQuotaAllocationsImpl(inner.getValue(), this.manager())); + new SubscriptionQuotaAllocationsListImpl(inner.getValue(), this.manager())); } else { return null; } } - public SubscriptionQuotaAllocations get(String managementGroupId, String groupQuotaName, String resourceName, - String filter) { - SubscriptionQuotaAllocationsInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, resourceName, filter); + public SubscriptionQuotaAllocationsList list(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location) { + SubscriptionQuotaAllocationsListInner inner + = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); if (inner != null) { - return new SubscriptionQuotaAllocationsImpl(inner, this.manager()); + return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java deleted file mode 100644 index 29db7b886ebfe..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java +++ /dev/null @@ -1,319 +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.quota.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.resourcemanager.quota.fluent.GroupQuotaUsagesClient; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.ResourceUsageList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaUsagesClient. - */ -public final class GroupQuotaUsagesClientImpl implements GroupQuotaUsagesClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaUsagesService service; - - /** - * The service client containing this operation class. - */ - private final AzureQuotaExtensionApiImpl client; - - /** - * Initializes an instance of GroupQuotaUsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaUsagesClientImpl(AzureQuotaExtensionApiImpl client) { - this.service - = RestProxy.create(GroupQuotaUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for AzureQuotaExtensionApiGroupQuotaUsages to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "AzureQuotaExtensionA") - public interface GroupQuotaUsagesService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationUsages/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName 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.list(this.client.getEndpoint(), managementGroupId, groupQuotaName, - resourceProviderName, location, 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())); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, 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 (managementGroupId == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); - } - if (groupQuotaName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupQuotaName is required and cannot be null.")); - } - if (resourceProviderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceProviderName 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 - .list(this.client.getEndpoint(), managementGroupId, groupQuotaName, resourceProviderName, location, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, location), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, location, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return new PagedIterable<>(listAsync(managementGroupId, groupQuotaName, resourceProviderName, location)); - } - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - return new PagedIterable<>( - listAsync(managementGroupId, groupQuotaName, resourceProviderName, location, 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 resource usages and quotas for GroupQuota 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource usages and quotas for GroupQuota along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java deleted file mode 100644 index 804730198b1df..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java +++ /dev/null @@ -1,49 +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.quota.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.quota.fluent.GroupQuotaUsagesClient; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsages; -import com.azure.resourcemanager.quota.models.ResourceUsages; - -public final class GroupQuotaUsagesImpl implements GroupQuotaUsages { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaUsagesImpl.class); - - private final GroupQuotaUsagesClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaUsagesImpl(GroupQuotaUsagesClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsagesImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsagesImpl(inner1, this.manager())); - } - - private GroupQuotaUsagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementResponseImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementResponseImpl.java deleted file mode 100644 index 5c13e68d8e04c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementResponseImpl.java +++ /dev/null @@ -1,50 +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.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponse; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; - -public final class GroupQuotasEnforcementResponseImpl implements GroupQuotasEnforcementResponse { - private GroupQuotasEnforcementResponseInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotasEnforcementResponseImpl(GroupQuotasEnforcementResponseInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotasEnforcementResponseProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotasEnforcementResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java index c5e217912977e..641da4affc15d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java @@ -7,7 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; public final class GroupQuotasEntityImpl implements GroupQuotasEntity { private GroupQuotasEntityInner innerObject; @@ -32,7 +32,7 @@ public String type() { return this.innerModel().type(); } - public GroupQuotasEntityBase properties() { + public GroupQuotasEntityProperties properties() { return this.innerModel().properties(); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java deleted file mode 100644 index abc196e27dea9..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java +++ /dev/null @@ -1,49 +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.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import com.azure.resourcemanager.quota.models.ResourceUsages; - -public final class ResourceUsagesImpl implements ResourceUsages { - private ResourceUsagesInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - ResourceUsagesImpl(ResourceUsagesInner innerObject, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotaUsagesBase properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ResourceUsagesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java similarity index 68% rename from sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsImpl.java rename to sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java index d1c9fd945f8ec..6fd2ec61b1dae 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java @@ -5,16 +5,16 @@ package com.azure.resourcemanager.quota.implementation; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaDetails; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; -public final class SubscriptionQuotaAllocationsImpl implements SubscriptionQuotaAllocations { - private SubscriptionQuotaAllocationsInner innerObject; +public final class SubscriptionQuotaAllocationsListImpl implements SubscriptionQuotaAllocationsList { + private SubscriptionQuotaAllocationsListInner innerObject; private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - SubscriptionQuotaAllocationsImpl(SubscriptionQuotaAllocationsInner innerObject, + SubscriptionQuotaAllocationsListImpl(SubscriptionQuotaAllocationsListInner innerObject, com.azure.resourcemanager.quota.QuotaManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -32,7 +32,7 @@ public String type() { return this.innerModel().type(); } - public SubscriptionQuotaDetails properties() { + public SubscriptionQuotaAllocationsListProperties properties() { return this.innerModel().properties(); } @@ -40,7 +40,7 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public SubscriptionQuotaAllocationsInner innerModel() { + public SubscriptionQuotaAllocationsListInner innerModel() { return this.innerObject; } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributes.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributes.java deleted file mode 100644 index 1d16343418764..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributes.java +++ /dev/null @@ -1,133 +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.quota.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; - -/** - * Additional attribute or filter to allow subscriptions meeting the requirements to be part of the GroupQuota. - */ -@Fluent -public final class AdditionalAttributes implements JsonSerializable { - /* - * The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. - */ - private GroupingId groupId; - - /* - * Environment name. - */ - private EnvironmentType environment; - - /** - * Creates an instance of AdditionalAttributes class. - */ - public AdditionalAttributes() { - } - - /** - * Get the groupId property: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - * applicable. - * - * @return the groupId value. - */ - public GroupingId groupId() { - return this.groupId; - } - - /** - * Set the groupId property: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - * applicable. - * - * @param groupId the groupId value to set. - * @return the AdditionalAttributes object itself. - */ - public AdditionalAttributes withGroupId(GroupingId groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the environment property: Environment name. - * - * @return the environment value. - */ - public EnvironmentType environment() { - return this.environment; - } - - /** - * Set the environment property: Environment name. - * - * @param environment the environment value to set. - * @return the AdditionalAttributes object itself. - */ - public AdditionalAttributes withEnvironment(EnvironmentType environment) { - this.environment = environment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (groupId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property groupId in model AdditionalAttributes")); - } else { - groupId().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AdditionalAttributes.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("groupId", this.groupId); - jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdditionalAttributes from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdditionalAttributes 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 AdditionalAttributes. - */ - public static AdditionalAttributes fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdditionalAttributes deserializedAdditionalAttributes = new AdditionalAttributes(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedAdditionalAttributes.groupId = GroupingId.fromJson(reader); - } else if ("environment".equals(fieldName)) { - deserializedAdditionalAttributes.environment = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdditionalAttributes; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributesPatch.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributesPatch.java deleted file mode 100644 index e535c502a8760..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AdditionalAttributesPatch.java +++ /dev/null @@ -1,126 +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.quota.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; - -/** - * Additional attribute or filter to allow subscriptions meeting the requirements to be part of the GroupQuota. - */ -@Fluent -public final class AdditionalAttributesPatch implements JsonSerializable { - /* - * The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. - */ - private GroupingId groupId; - - /* - * Environment name. - */ - private EnvironmentType environment; - - /** - * Creates an instance of AdditionalAttributesPatch class. - */ - public AdditionalAttributesPatch() { - } - - /** - * Get the groupId property: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - * applicable. - * - * @return the groupId value. - */ - public GroupingId groupId() { - return this.groupId; - } - - /** - * Set the groupId property: The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if - * applicable. - * - * @param groupId the groupId value to set. - * @return the AdditionalAttributesPatch object itself. - */ - public AdditionalAttributesPatch withGroupId(GroupingId groupId) { - this.groupId = groupId; - return this; - } - - /** - * Get the environment property: Environment name. - * - * @return the environment value. - */ - public EnvironmentType environment() { - return this.environment; - } - - /** - * Set the environment property: Environment name. - * - * @param environment the environment value to set. - * @return the AdditionalAttributesPatch object itself. - */ - public AdditionalAttributesPatch withEnvironment(EnvironmentType environment) { - this.environment = environment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (groupId() != null) { - groupId().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("groupId", this.groupId); - jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdditionalAttributesPatch from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdditionalAttributesPatch 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 AdditionalAttributesPatch. - */ - public static AdditionalAttributesPatch fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdditionalAttributesPatch deserializedAdditionalAttributesPatch = new AdditionalAttributesPatch(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedAdditionalAttributesPatch.groupId = GroupingId.fromJson(reader); - } else if ("environment".equals(fieldName)) { - deserializedAdditionalAttributesPatch.environment = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdditionalAttributesPatch; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java deleted file mode 100644 index 1d41b4a148306..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java +++ /dev/null @@ -1,56 +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.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enforcement status. - */ -public final class EnforcementState extends ExpandableStringEnum { - /** - * Static value Enabled for EnforcementState. - */ - public static final EnforcementState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for EnforcementState. - */ - public static final EnforcementState DISABLED = fromString("Disabled"); - - /** - * Static value NotAvailable for EnforcementState. - */ - public static final EnforcementState NOT_AVAILABLE = fromString("NotAvailable"); - - /** - * Creates a new instance of EnforcementState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnforcementState() { - } - - /** - * Creates or finds a EnforcementState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnforcementState. - */ - public static EnforcementState fromString(String name) { - return fromString(name, EnforcementState.class); - } - - /** - * Gets known EnforcementState values. - * - * @return known EnforcementState values. - */ - public static Collection values() { - return values(EnforcementState.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnvironmentType.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnvironmentType.java deleted file mode 100644 index 65cee331e265c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnvironmentType.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.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Environment name. - */ -public final class EnvironmentType extends ExpandableStringEnum { - /** - * Static value NonProduction for EnvironmentType. - */ - public static final EnvironmentType NON_PRODUCTION = fromString("NonProduction"); - - /** - * Static value Production for EnvironmentType. - */ - public static final EnvironmentType PRODUCTION = fromString("Production"); - - /** - * Creates a new instance of EnvironmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnvironmentType() { - } - - /** - * Creates or finds a EnvironmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnvironmentType. - */ - public static EnvironmentType fromString(String name) { - return fromString(name, EnvironmentType.class); - } - - /** - * Gets known EnvironmentType values. - * - * @return known EnvironmentType values. - */ - public static Collection values() { - return values(EnvironmentType.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java index 37d804cc4087b..41f0e58f90814 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java @@ -16,11 +16,11 @@ * Group Quota details. */ @Fluent -public final class GroupQuotaDetails implements JsonSerializable { +public class GroupQuotaDetails implements JsonSerializable { /* - * Location/Azure region for the quota requested for resource. + * The resource name, such as SKU name. */ - private String region; + private String resourceName; /* * The current Group Quota Limit at the parentId level. @@ -32,18 +32,18 @@ public final class GroupQuotaDetails implements JsonSerializable { + /* + * Group Quota properties for the specified resource. + */ + private GroupQuotaLimitProperties properties; + /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. + * Creates an instance of GroupQuotaLimit class. */ - String id(); + public GroupQuotaLimit() { + } /** - * Gets the name property: The name of the resource. + * Get the properties property: Group Quota properties for the specified resource. * - * @return the name value. + * @return the properties value. */ - String name(); + public GroupQuotaLimitProperties properties() { + return this.properties; + } /** - * Gets the type property: The type of the resource. + * Set the properties property: Group Quota properties for the specified resource. * - * @return the type value. + * @param properties the properties value to set. + * @return the GroupQuotaLimit object itself. */ - String type(); + public GroupQuotaLimit withProperties(GroupQuotaLimitProperties properties) { + this.properties = properties; + return this; + } /** - * Gets the properties property: Group Quota properties for the specified resource. + * Validates the instance. * - * @return the properties value. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - GroupQuotaDetails properties(); + public void validate() { + if (properties() != null) { + properties().validate(); + } + } /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. + * {@inheritDoc} */ - SystemData systemData(); + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner object. + * Reads an instance of GroupQuotaLimit from the JsonReader. * - * @return the inner object. + * @param jsonReader The JsonReader being read. + * @return An instance of GroupQuotaLimit 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 GroupQuotaLimit. */ - GroupQuotaLimitInner innerModel(); + public static GroupQuotaLimit fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupQuotaLimit deserializedGroupQuotaLimit = new GroupQuotaLimit(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedGroupQuotaLimit.properties = GroupQuotaLimitProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupQuotaLimit; + }); + } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java index 46978bc53ed7d..e97ec8df7e470 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java @@ -4,113 +4,52 @@ package com.azure.resourcemanager.quota.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 com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import java.io.IOException; -import java.util.List; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; /** - * List of Group Quota Limit details. + * An immutable client-side representation of GroupQuotaLimitList. */ -@Fluent -public final class GroupQuotaLimitList implements JsonSerializable { - /* - * List of Group Quota Limit details. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotaLimitList class. - */ - public GroupQuotaLimitList() { - } - +public interface GroupQuotaLimitList { /** - * Get the value property: List of Group Quota Limit details. + * Gets the id property: Fully qualified resource Id for the resource. * - * @return the value value. + * @return the id value. */ - public List value() { - return this.value; - } + String id(); /** - * Set the value property: List of Group Quota Limit details. + * Gets the name property: The name of the resource. * - * @param value the value value to set. - * @return the GroupQuotaLimitList object itself. + * @return the name value. */ - public GroupQuotaLimitList withValue(List value) { - this.value = value; - return this; - } + String name(); /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Gets the type property: The type of the resource. * - * @return the nextLink value. + * @return the type value. */ - public String nextLink() { - return this.nextLink; - } + String type(); /** - * Validates the instance. + * Gets the properties property: The properties property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the properties value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } + GroupQuotaLimitListProperties properties(); /** - * {@inheritDoc} + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } + SystemData systemData(); /** - * Reads an instance of GroupQuotaLimitList from the JsonReader. + * Gets the inner com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner object. * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimitList 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 GroupQuotaLimitList. + * @return the inner object. */ - public static GroupQuotaLimitList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimitList deserializedGroupQuotaLimitList = new GroupQuotaLimitList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupQuotaLimitInner.fromJson(reader1)); - deserializedGroupQuotaLimitList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotaLimitList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimitList; - }); - } + GroupQuotaLimitListInner innerModel(); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsageList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java similarity index 50% rename from sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsageList.java rename to sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java index cbcb185957920..e0b2723239d0c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsageList.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java @@ -9,19 +9,23 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; import java.io.IOException; import java.util.List; /** - * List of resource usages and quotas for GroupQuota. + * The GroupQuotaLimitListProperties model. */ @Fluent -public final class ResourceUsageList implements JsonSerializable { +public final class GroupQuotaLimitListProperties implements JsonSerializable { /* - * List of resource usages at Group Quotas. + * Request status. */ - private List value; + private RequestState provisioningState; + + /* + * List of Group Quota Limit details. + */ + private List value; /* * The URL to use for getting the next set of results. @@ -29,27 +33,36 @@ public final class ResourceUsageList implements JsonSerializable value() { + public List value() { return this.value; } /** - * Set the value property: List of resource usages at Group Quotas. + * Set the value property: List of Group Quota Limit details. * * @param value the value value to set. - * @return the ResourceUsageList object itself. + * @return the GroupQuotaLimitListProperties object itself. */ - public ResourceUsageList withValue(List value) { + public GroupQuotaLimitListProperties withValue(List value) { this.value = value; return this; } @@ -85,32 +98,35 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResourceUsageList from the JsonReader. + * Reads an instance of GroupQuotaLimitListProperties from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResourceUsageList 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 ResourceUsageList. + * @return An instance of GroupQuotaLimitListProperties 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 GroupQuotaLimitListProperties. */ - public static ResourceUsageList fromJson(JsonReader jsonReader) throws IOException { + public static GroupQuotaLimitListProperties fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResourceUsageList deserializedResourceUsageList = new ResourceUsageList(); + GroupQuotaLimitListProperties deserializedGroupQuotaLimitListProperties + = new GroupQuotaLimitListProperties(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ResourceUsagesInner.fromJson(reader1)); - deserializedResourceUsageList.value = value; + if ("provisioningState".equals(fieldName)) { + deserializedGroupQuotaLimitListProperties.provisioningState + = RequestState.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> GroupQuotaLimit.fromJson(reader1)); + deserializedGroupQuotaLimitListProperties.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedResourceUsageList.nextLink = reader.getString(); + deserializedGroupQuotaLimitListProperties.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedResourceUsageList; + return deserializedGroupQuotaLimitListProperties; }); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java new file mode 100644 index 0000000000000..ab7057edefc83 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaDetailsName; +import java.io.IOException; + +/** + * Group Quota properties for the specified resource. + */ +@Fluent +public final class GroupQuotaLimitProperties extends GroupQuotaDetails { + /* + * Quota allocated to subscriptions + */ + private AllocatedQuotaToSubscriptionList allocatedToSubscriptions; + + /* + * The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). + */ + private Long availableLimit; + + /* + * Name of the resource provided by the resource provider. This property is already included in the request URI, so + * it is a readonly property returned in the response. + */ + private GroupQuotaDetailsName innerName; + + /* + * The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET + * response in the request body of your PUT operation. + */ + private String unit; + + /** + * Creates an instance of GroupQuotaLimitProperties class. + */ + public GroupQuotaLimitProperties() { + } + + /** + * Get the allocatedToSubscriptions property: Quota allocated to subscriptions. + * + * @return the allocatedToSubscriptions value. + */ + @Override + public AllocatedQuotaToSubscriptionList allocatedToSubscriptions() { + return this.allocatedToSubscriptions; + } + + /** + * Get the availableLimit property: The available Group Quota Limit at the MG level. This Group quota can be + * allocated to subscription(s). + * + * @return the availableLimit value. + */ + @Override + public Long availableLimit() { + return this.availableLimit; + } + + /** + * Get the innerName property: Name of the resource provided by the resource provider. This property is already + * included in the request URI, so it is a readonly property returned in the response. + * + * @return the innerName value. + */ + private GroupQuotaDetailsName innerName() { + return this.innerName; + } + + /** + * Get the unit property: The usages units, such as Count and Bytes. When requesting quota, use the **unit** value + * returned in the GET response in the request body of your PUT operation. + * + * @return the unit value. + */ + @Override + public String unit() { + return this.unit; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupQuotaLimitProperties withResourceName(String resourceName) { + super.withResourceName(resourceName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupQuotaLimitProperties withLimit(Long limit) { + super.withLimit(limit); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupQuotaLimitProperties withComment(String comment) { + super.withComment(comment); + return this; + } + + /** + * Get the value property: Resource name. + * + * @return the value value. + */ + public String value() { + return this.innerName() == null ? null : this.innerName().value(); + } + + /** + * Get the localizedValue property: Resource display name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.innerName() == null ? null : this.innerName().localizedValue(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerName() != null) { + innerName().validate(); + } + if (allocatedToSubscriptions() != null) { + allocatedToSubscriptions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceName", resourceName()); + jsonWriter.writeNumberField("limit", limit()); + jsonWriter.writeStringField("comment", comment()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupQuotaLimitProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupQuotaLimitProperties 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 GroupQuotaLimitProperties. + */ + public static GroupQuotaLimitProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupQuotaLimitProperties deserializedGroupQuotaLimitProperties = new GroupQuotaLimitProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceName".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.withResourceName(reader.getString()); + } else if ("limit".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.withLimit(reader.getNullable(JsonReader::getLong)); + } else if ("comment".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.withComment(reader.getString()); + } else if ("unit".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.unit = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.innerName = GroupQuotaDetailsName.fromJson(reader); + } else if ("availableLimit".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.availableLimit = reader.getNullable(JsonReader::getLong); + } else if ("allocatedToSubscriptions".equals(fieldName)) { + deserializedGroupQuotaLimitProperties.allocatedToSubscriptions + = AllocatedQuotaToSubscriptionList.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupQuotaLimitProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java index 571c729e2e5d6..2c4294864350d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.quota.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -13,109 +12,39 @@ */ public interface GroupQuotaLimits { /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param location The name of the 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 the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota along with - * {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String resourceName, String filter, Context context); - - /** - * Gets the GroupQuotaLimits for the specific resource. - * - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specific resource for a specific resource based on the resourceProviders, - * resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU} along with {@link Response}. */ - GroupQuotaLimit get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, String filter); + Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context); /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String filter); - - /** - * Gets the GroupQuotaLimits for all the resources for the specified location in $filter=location eq {location}. - * - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. + * @param location The name of the 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 the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota as paginated response - * with {@link PagedIterable}. + * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in + * $filter=resourceName eq {SKU}. */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String filter, Context context); + GroupQuotaLimitList list(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java index a35169769764e..44a14a5920490 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java @@ -6,68 +6,19 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; -import com.azure.core.management.ProxyResource; import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; /** * Resource collection API of GroupQuotaLimitsRequests. */ public interface GroupQuotaLimitsRequests { - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return status of a single GroupQuota request. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName); - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. - * - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * ("name": {"value" : "resourceName") properties are specified in the request body. Only 1 resource quota can be - * requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this 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 status of a single GroupQuota request. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context); - /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -76,21 +27,21 @@ ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, St * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the 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 status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ - SubmittedResourceRequestStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName); + GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location); /** * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. * - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and resourceName - * properties are specified in the request body. Only 1 resource quota can be requested. Please note that patch - * request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are + * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a + * new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after * duration in seconds to check the intermediate status. This API provides the finals status with the request * details and status. @@ -99,16 +50,16 @@ SubmittedResourceRequestStatus update(String managementGroupId, String groupQuot * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. * @param context The context to associate with this 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 status of a single GroupQuota request. + * @return list of Group Quota Limit details. */ - SubmittedResourceRequestStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, SubmittedResourceRequestStatusInner groupQuotaRequest, Context context); + GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location, GroupQuotaLimitListInner groupQuotaRequest, Context context); /** * Get the status of a single GroupQuota request by requestId. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java deleted file mode 100644 index e947c6fc1f54a..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java +++ /dev/null @@ -1,208 +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.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; - -/** - * Resource collection API of GroupQuotaLocationSettings. - */ -public interface GroupQuotaLocationSettings { - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementResponseInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementResponse update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement settings for the resource provider and the location specified. - * - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementResponse update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementResponseInner locationSettings, Context context); - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotas enforcement settings for the resource provider/location. - * - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - GroupQuotasEnforcementResponse get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName); - - /** - * Returns a list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. The locations - * not included in GroupQuota Enforcement will not be listed, the regions in failed status with listed as status - * Failed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Azure regions, where the group quotas is enabled for enforcement as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java index d2fcc49c72c3a..6fd89a263548e 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java @@ -6,14 +6,63 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; -import com.azure.core.management.ProxyResource; import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; /** * Resource collection API of GroupQuotaSubscriptionAllocationRequests. */ public interface GroupQuotaSubscriptionAllocationRequests { + /** + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. + * + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * + * @param managementGroupId Management Group Id. + * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return subscription quota list. + */ + SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest); + + /** + * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern + * with 202 response and status polling API. + * + * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or + * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. + * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can + * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple + * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. + * + * @param managementGroupId Management Group Id. + * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. + * @param allocateQuotaRequest Quota requests payload. + * @param context The context to associate with this 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 subscription quota list. + */ + SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, + Context context); + /** * Get the status of the quota allocation request for the subscriptionId. * @@ -21,6 +70,8 @@ public interface GroupQuotaSubscriptionAllocationRequests { * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. * @param allocationId Request Id. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -29,7 +80,7 @@ public interface GroupQuotaSubscriptionAllocationRequests { * @return the quota allocation request status for the subscriptionId by allocationId along with {@link Response}. */ Response getWithResponse(String managementGroupId, String groupQuotaName, - String allocationId, Context context); + String resourceProviderName, String allocationId, Context context); /** * Get the status of the quota allocation request for the subscriptionId. @@ -38,13 +89,16 @@ Response getWithResponse(String managementGroupId, * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. * @param allocationId Request 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 the quota allocation request status for the subscriptionId by allocationId. */ - QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, String allocationId); + QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, String resourceProviderName, + String allocationId); /** * Get all the quotaAllocationRequests for a resourceProvider/location. @@ -94,102 +148,4 @@ PagedIterable list(String managementGroupId, Strin */ PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, String filter, Context context); - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest); - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * to check the status using Async polling as standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this 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 subscription quota allocation status. - */ - ProxyResource createOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context); - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the subscription quota allocation status. - */ - QuotaAllocationRequestStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest); - - /** - * Request to assign quota from group quota to a specific Subscription. This request will use Asynchronous pattern - * with 202 response and status polling API. - * - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this 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 subscription quota allocation status. - */ - QuotaAllocationRequestStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String resourceName, QuotaAllocationRequestStatusInner allocateQuotaRequest, Context context); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java index 2924678b0d65e..ef1f21ea48397 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.quota.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -13,98 +12,47 @@ */ public interface GroupQuotaSubscriptionAllocations { /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String filter); - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. - * - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This will include - * the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription - * can be allocated back to the MG Group Quota. Use the $filter parameter to filter out the specific resource based - * on the ResourceProvider/Location. $filter is a required parameter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 all the quota allocated to a subscription for the specific Resource Provider, Location as paginated - * response with {@link PagedIterable}. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU} along with {@link Response}. */ - PagedIterable list(String managementGroupId, String groupQuotaName, String filter, - Context context); + Response listWithResponse(String managementGroupId, String groupQuotaName, + String resourceProviderName, String location, Context context); /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. + * Gets all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the + * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. * * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName along with - * {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceName, String filter, Context context); - - /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - * - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will - * include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the - * subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the 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 quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. + * @return all the quota allocated to a subscription for the specified resource provider and location for resource + * names passed in $filter=resourceName eq {SKU}. */ - SubscriptionQuotaAllocations get(String managementGroupId, String groupQuotaName, String resourceName, - String filter); + SubscriptionQuotaAllocationsList list(String managementGroupId, String groupQuotaName, String resourceProviderName, + String location); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java index 4046fff0b9614..3630e952c77a0 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.quota.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The GroupQuotaSubscriptionIdProperties model. */ -@Immutable +@Fluent public final class GroupQuotaSubscriptionIdProperties implements JsonSerializable { /* * An Azure subscriptionId. @@ -41,6 +41,17 @@ public String subscriptionId() { return this.subscriptionId; } + /** + * Set the subscriptionId property: An Azure subscriptionId. + * + * @param subscriptionId the subscriptionId value to set. + * @return the GroupQuotaSubscriptionIdProperties object itself. + */ + public GroupQuotaSubscriptionIdProperties withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** * Get the provisioningState property: Status of this subscriptionId being associated with the GroupQuotasEntity. * @@ -64,6 +75,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subscriptionId", this.subscriptionId); return jsonWriter.writeEndObject(); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java deleted file mode 100644 index 91c176de4ee84..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java +++ /dev/null @@ -1,50 +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.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaUsages. - */ -public interface GroupQuotaUsages { - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Gets the GroupQuotas usages and limits(quota) for the resourceProvider/location. - * - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the 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 the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java deleted file mode 100644 index da498d0e0e753..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java +++ /dev/null @@ -1,197 +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.quota.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 com.azure.resourcemanager.quota.fluent.models.GroupQuotaUsagesBaseName; -import java.io.IOException; - -/** - * Resource details with usages and GroupQuota. - */ -@Fluent -public final class GroupQuotaUsagesBase implements JsonSerializable { - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private GroupQuotaUsagesBaseName innerName; - - /* - * Quota/limits for the resource. - */ - private Long limit; - - /* - * Usages for the resource. - */ - private Long usages; - - /* - * Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, - * BytesPerSecond. Based on - https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . - * Different RPs may have different units, Count, type as int64 should work for most of the integer values. - */ - private String unit; - - /** - * Creates an instance of GroupQuotaUsagesBase class. - */ - public GroupQuotaUsagesBase() { - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private GroupQuotaUsagesBaseName innerName() { - return this.innerName; - } - - /** - * Get the limit property: Quota/limits for the resource. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: Quota/limits for the resource. - * - * @param limit the limit value to set. - * @return the GroupQuotaUsagesBase object itself. - */ - public GroupQuotaUsagesBase withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the usages property: Usages for the resource. - * - * @return the usages value. - */ - public Long usages() { - return this.usages; - } - - /** - * Set the usages property: Usages for the resource. - * - * @param usages the usages value to set. - * @return the GroupQuotaUsagesBase object itself. - */ - public GroupQuotaUsagesBase withUsages(Long usages) { - this.usages = usages; - return this; - } - - /** - * Get the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, - * Percent, CountPerSecond, BytesPerSecond. Based on - - * https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . Different RPs may have - * different units, Count, type as int64 should work for most of the integer values. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Set the value property: Resource name. - * - * @param value the value value to set. - * @return the GroupQuotaUsagesBase object itself. - */ - public GroupQuotaUsagesBase withValue(String value) { - if (this.innerName() == null) { - this.innerName = new GroupQuotaUsagesBaseName(); - } - this.innerName().withValue(value); - return this; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerName() != null) { - innerName().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("name", this.innerName); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeNumberField("usages", this.usages); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaUsagesBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaUsagesBase 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 GroupQuotaUsagesBase. - */ - public static GroupQuotaUsagesBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaUsagesBase deserializedGroupQuotaUsagesBase = new GroupQuotaUsagesBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.innerName = GroupQuotaUsagesBaseName.fromJson(reader); - } else if ("limit".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.limit = reader.getNullable(JsonReader::getLong); - } else if ("usages".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.usages = reader.getNullable(JsonReader::getLong); - } else if ("unit".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.unit = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaUsagesBase; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementListResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementListResponse.java deleted file mode 100644 index 77a45b7bc65d3..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementListResponse.java +++ /dev/null @@ -1,117 +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.quota.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 com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Azure regions, where the group quotas is enabled for enforcement. - */ -@Fluent -public final class GroupQuotasEnforcementListResponse implements JsonSerializable { - /* - * List of Azure Regions. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotasEnforcementListResponse class. - */ - public GroupQuotasEnforcementListResponse() { - } - - /** - * Get the value property: List of Azure Regions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Azure Regions. - * - * @param value the value value to set. - * @return the GroupQuotasEnforcementListResponse object itself. - */ - public GroupQuotasEnforcementListResponse withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEnforcementListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEnforcementListResponse 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 GroupQuotasEnforcementListResponse. - */ - public static GroupQuotasEnforcementListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEnforcementListResponse deserializedGroupQuotasEnforcementListResponse - = new GroupQuotasEnforcementListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupQuotasEnforcementResponseInner.fromJson(reader1)); - deserializedGroupQuotasEnforcementListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotasEnforcementListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEnforcementListResponse; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponse.java deleted file mode 100644 index d35a5d0d46a38..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponse.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.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; - -/** - * An immutable client-side representation of GroupQuotasEnforcementResponse. - */ -public interface GroupQuotasEnforcementResponse { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The properties property. - * - * @return the properties value. - */ - GroupQuotasEnforcementResponseProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner object. - * - * @return the inner object. - */ - GroupQuotasEnforcementResponseInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponseProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponseProperties.java deleted file mode 100644 index d94c51fc2e19c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementResponseProperties.java +++ /dev/null @@ -1,130 +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.quota.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; - -/** - * The GroupQuotasEnforcementResponseProperties model. - */ -@Fluent -public final class GroupQuotasEnforcementResponseProperties - implements JsonSerializable { - /* - * Is the GroupQuota Enforcement enabled for the Azure region. - */ - private EnforcementState enforcementEnabled; - - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * Details of the failure. - */ - private String faultCode; - - /** - * Creates an instance of GroupQuotasEnforcementResponseProperties class. - */ - public GroupQuotasEnforcementResponseProperties() { - } - - /** - * Get the enforcementEnabled property: Is the GroupQuota Enforcement enabled for the Azure region. - * - * @return the enforcementEnabled value. - */ - public EnforcementState enforcementEnabled() { - return this.enforcementEnabled; - } - - /** - * Set the enforcementEnabled property: Is the GroupQuota Enforcement enabled for the Azure region. - * - * @param enforcementEnabled the enforcementEnabled value to set. - * @return the GroupQuotasEnforcementResponseProperties object itself. - */ - public GroupQuotasEnforcementResponseProperties withEnforcementEnabled(EnforcementState enforcementEnabled) { - this.enforcementEnabled = enforcementEnabled; - return this; - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - public String faultCode() { - return this.faultCode; - } - - /** - * 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(); - jsonWriter.writeStringField("enforcementEnabled", - this.enforcementEnabled == null ? null : this.enforcementEnabled.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEnforcementResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEnforcementResponseProperties 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 GroupQuotasEnforcementResponseProperties. - */ - public static GroupQuotasEnforcementResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEnforcementResponseProperties deserializedGroupQuotasEnforcementResponseProperties - = new GroupQuotasEnforcementResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enforcementEnabled".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseProperties.enforcementEnabled - = EnforcementState.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("faultCode".equals(fieldName)) { - deserializedGroupQuotasEnforcementResponseProperties.faultCode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEnforcementResponseProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java index 0b26c44c9cb22..722287fde0d7d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java @@ -33,12 +33,11 @@ public interface GroupQuotasEntity { String type(); /** - * Gets the properties property: Properties and filters for ShareQuota. The request parameter is optional, if there - * are no filters specified. + * Gets the properties property: Properties. * * @return the properties value. */ - GroupQuotasEntityBase properties(); + GroupQuotasEntityProperties properties(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java index 182ebd88398f8..9514feae6c8af 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java @@ -15,17 +15,12 @@ * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ @Fluent -public final class GroupQuotasEntityBase implements JsonSerializable { +public class GroupQuotasEntityBase implements JsonSerializable { /* * Display name of the GroupQuota entity. */ private String displayName; - /* - * Additional attributes to filter/restrict the subscriptions, which can be added to the subscriptionIds. - */ - private AdditionalAttributes additionalAttributes; - /* * Provisioning state of the operation. */ @@ -58,45 +53,31 @@ public GroupQuotasEntityBase withDisplayName(String displayName) { } /** - * Get the additionalAttributes property: Additional attributes to filter/restrict the subscriptions, which can be - * added to the subscriptionIds. + * Get the provisioningState property: Provisioning state of the operation. * - * @return the additionalAttributes value. + * @return the provisioningState value. */ - public AdditionalAttributes additionalAttributes() { - return this.additionalAttributes; + public RequestState provisioningState() { + return this.provisioningState; } /** - * Set the additionalAttributes property: Additional attributes to filter/restrict the subscriptions, which can be - * added to the subscriptionIds. + * Set the provisioningState property: Provisioning state of the operation. * - * @param additionalAttributes the additionalAttributes value to set. + * @param provisioningState the provisioningState value to set. * @return the GroupQuotasEntityBase object itself. */ - public GroupQuotasEntityBase withAdditionalAttributes(AdditionalAttributes additionalAttributes) { - this.additionalAttributes = additionalAttributes; + GroupQuotasEntityBase withProvisioningState(RequestState provisioningState) { + this.provisioningState = provisioningState; return this; } - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (additionalAttributes() != null) { - additionalAttributes().validate(); - } } /** @@ -106,7 +87,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeJsonField("additionalAttributes", this.additionalAttributes); return jsonWriter.writeEndObject(); } @@ -127,8 +107,6 @@ public static GroupQuotasEntityBase fromJson(JsonReader jsonReader) throws IOExc if ("displayName".equals(fieldName)) { deserializedGroupQuotasEntityBase.displayName = reader.getString(); - } else if ("additionalAttributes".equals(fieldName)) { - deserializedGroupQuotasEntityBase.additionalAttributes = AdditionalAttributes.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedGroupQuotasEntityBase.provisioningState = RequestState.fromString(reader.getString()); } else { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java index 27235d6277f26..7d39d0eff8aa2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java @@ -15,17 +15,12 @@ * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ @Fluent -public final class GroupQuotasEntityBasePatch implements JsonSerializable { +public class GroupQuotasEntityBasePatch implements JsonSerializable { /* * Display name of the GroupQuota entity. */ private String displayName; - /* - * Additional attributes to filter/restrict the subscriptions, which can be added to the subscriptionIds. - */ - private AdditionalAttributesPatch additionalAttributes; - /* * Provisioning state of the operation. */ @@ -58,45 +53,31 @@ public GroupQuotasEntityBasePatch withDisplayName(String displayName) { } /** - * Get the additionalAttributes property: Additional attributes to filter/restrict the subscriptions, which can be - * added to the subscriptionIds. + * Get the provisioningState property: Provisioning state of the operation. * - * @return the additionalAttributes value. + * @return the provisioningState value. */ - public AdditionalAttributesPatch additionalAttributes() { - return this.additionalAttributes; + public RequestState provisioningState() { + return this.provisioningState; } /** - * Set the additionalAttributes property: Additional attributes to filter/restrict the subscriptions, which can be - * added to the subscriptionIds. + * Set the provisioningState property: Provisioning state of the operation. * - * @param additionalAttributes the additionalAttributes value to set. + * @param provisioningState the provisioningState value to set. * @return the GroupQuotasEntityBasePatch object itself. */ - public GroupQuotasEntityBasePatch withAdditionalAttributes(AdditionalAttributesPatch additionalAttributes) { - this.additionalAttributes = additionalAttributes; + GroupQuotasEntityBasePatch withProvisioningState(RequestState provisioningState) { + this.provisioningState = provisioningState; return this; } - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (additionalAttributes() != null) { - additionalAttributes().validate(); - } } /** @@ -106,7 +87,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeJsonField("additionalAttributes", this.additionalAttributes); return jsonWriter.writeEndObject(); } @@ -127,9 +107,6 @@ public static GroupQuotasEntityBasePatch fromJson(JsonReader jsonReader) throws if ("displayName".equals(fieldName)) { deserializedGroupQuotasEntityBasePatch.displayName = reader.getString(); - } else if ("additionalAttributes".equals(fieldName)) { - deserializedGroupQuotasEntityBasePatch.additionalAttributes - = AdditionalAttributesPatch.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedGroupQuotasEntityBasePatch.provisioningState = RequestState.fromString(reader.getString()); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java index 40872e6238319..eea2a4fce5d84 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java @@ -18,9 +18,9 @@ @Fluent public final class GroupQuotasEntityPatch extends ProxyResource { /* - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. + * Properties */ - private GroupQuotasEntityBasePatch properties; + private GroupQuotasEntityPatchProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -49,23 +49,21 @@ public GroupQuotasEntityPatch() { } /** - * Get the properties property: Properties and filters for ShareQuota. The request parameter is optional, if there - * are no filters specified. + * Get the properties property: Properties. * * @return the properties value. */ - public GroupQuotasEntityBasePatch properties() { + public GroupQuotasEntityPatchProperties properties() { return this.properties; } /** - * Set the properties property: Properties and filters for ShareQuota. The request parameter is optional, if there - * are no filters specified. + * Set the properties property: Properties. * * @param properties the properties value to set. * @return the GroupQuotasEntityPatch object itself. */ - public GroupQuotasEntityPatch withProperties(GroupQuotasEntityBasePatch properties) { + public GroupQuotasEntityPatch withProperties(GroupQuotasEntityPatchProperties properties) { this.properties = properties; return this; } @@ -153,7 +151,7 @@ public static GroupQuotasEntityPatch fromJson(JsonReader jsonReader) throws IOEx } else if ("type".equals(fieldName)) { deserializedGroupQuotasEntityPatch.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.properties = GroupQuotasEntityBasePatch.fromJson(reader); + deserializedGroupQuotasEntityPatch.properties = GroupQuotasEntityPatchProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedGroupQuotasEntityPatch.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java new file mode 100644 index 0000000000000..2ee8906793a0d --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties. + */ +@Fluent +public final class GroupQuotasEntityPatchProperties extends GroupQuotasEntityBasePatch { + /* + * Provisioning state of the operation. + */ + private RequestState provisioningState; + + /** + * Creates an instance of GroupQuotasEntityPatchProperties class. + */ + public GroupQuotasEntityPatchProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the operation. + * + * @return the provisioningState value. + */ + @Override + public RequestState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupQuotasEntityPatchProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", displayName()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupQuotasEntityPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupQuotasEntityPatchProperties 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 GroupQuotasEntityPatchProperties. + */ + public static GroupQuotasEntityPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupQuotasEntityPatchProperties deserializedGroupQuotasEntityPatchProperties + = new GroupQuotasEntityPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedGroupQuotasEntityPatchProperties.withDisplayName(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedGroupQuotasEntityPatchProperties.provisioningState + = RequestState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupQuotasEntityPatchProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java new file mode 100644 index 0000000000000..8d19cafd00520 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties. + */ +@Fluent +public final class GroupQuotasEntityProperties extends GroupQuotasEntityBase { + /* + * Provisioning state of the operation. + */ + private RequestState provisioningState; + + /** + * Creates an instance of GroupQuotasEntityProperties class. + */ + public GroupQuotasEntityProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the operation. + * + * @return the provisioningState value. + */ + @Override + public RequestState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public GroupQuotasEntityProperties withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", displayName()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GroupQuotasEntityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GroupQuotasEntityProperties 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 GroupQuotasEntityProperties. + */ + public static GroupQuotasEntityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GroupQuotasEntityProperties deserializedGroupQuotasEntityProperties = new GroupQuotasEntityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedGroupQuotasEntityProperties.withDisplayName(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedGroupQuotasEntityProperties.provisioningState + = RequestState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGroupQuotasEntityProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingId.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingId.java deleted file mode 100644 index 49731f6e6dc14..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingId.java +++ /dev/null @@ -1,124 +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.quota.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; - -/** - * The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. - */ -@Fluent -public final class GroupingId implements JsonSerializable { - /* - * GroupingId type. It is a required property. More types of groupIds can be supported in future. - */ - private GroupingIdType groupingIdType; - - /* - * GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. - */ - private String value; - - /** - * Creates an instance of GroupingId class. - */ - public GroupingId() { - } - - /** - * Get the groupingIdType property: GroupingId type. It is a required property. More types of groupIds can be - * supported in future. - * - * @return the groupingIdType value. - */ - public GroupingIdType groupingIdType() { - return this.groupingIdType; - } - - /** - * Set the groupingIdType property: GroupingId type. It is a required property. More types of groupIds can be - * supported in future. - * - * @param groupingIdType the groupingIdType value to set. - * @return the GroupingId object itself. - */ - public GroupingId withGroupingIdType(GroupingIdType groupingIdType) { - this.groupingIdType = groupingIdType; - return this; - } - - /** - * Get the value property: GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. - * - * @param value the value value to set. - * @return the GroupingId object itself. - */ - public GroupingId withValue(String value) { - this.value = value; - return this; - } - - /** - * 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(); - jsonWriter.writeStringField("groupingIdType", - this.groupingIdType == null ? null : this.groupingIdType.toString()); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupingId from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupingId 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 GroupingId. - */ - public static GroupingId fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupingId deserializedGroupingId = new GroupingId(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupingIdType".equals(fieldName)) { - deserializedGroupingId.groupingIdType = GroupingIdType.fromString(reader.getString()); - } else if ("value".equals(fieldName)) { - deserializedGroupingId.value = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupingId; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingIdType.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingIdType.java deleted file mode 100644 index 3c1ae62b60b21..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupingIdType.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.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * GroupingId type. It is a required property. More types of groupIds can be supported in future. - */ -public final class GroupingIdType extends ExpandableStringEnum { - /** - * Static value ServiceTreeId for GroupingIdType. - */ - public static final GroupingIdType SERVICE_TREE_ID = fromString("ServiceTreeId"); - - /** - * Static value BillingId for GroupingIdType. - */ - public static final GroupingIdType BILLING_ID = fromString("BillingId"); - - /** - * Creates a new instance of GroupingIdType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GroupingIdType() { - } - - /** - * Creates or finds a GroupingIdType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupingIdType. - */ - public static GroupingIdType fromString(String name) { - return fromString(name, GroupingIdType.class); - } - - /** - * Gets known GroupingIdType values. - * - * @return known GroupingIdType values. - */ - public static Collection values() { - return values(GroupingIdType.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java deleted file mode 100644 index 6f4a13caa7cd0..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.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.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; - -/** - * An immutable client-side representation of ResourceUsages. - */ -public interface ResourceUsages { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Resource details with usages and GroupQuota. - * - * @return the properties value. - */ - GroupQuotaUsagesBase properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner object. - * - * @return the inner object. - */ - ResourceUsagesInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java index 549c579fe6e39..5ec35802e9cad 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java @@ -4,52 +4,96 @@ package com.azure.resourcemanager.quota.models; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; +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; /** - * An immutable client-side representation of SubscriptionQuotaAllocations. + * Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the + * GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be + * allocated back to the MG Group Quota. */ -public interface SubscriptionQuotaAllocations { +@Fluent +public final class SubscriptionQuotaAllocations implements JsonSerializable { + /* + * Quota properties for the specified resource. + */ + private SubscriptionQuotaAllocationsProperties properties; + /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. + * Creates an instance of SubscriptionQuotaAllocations class. */ - String id(); + public SubscriptionQuotaAllocations() { + } /** - * Gets the name property: The name of the resource. + * Get the properties property: Quota properties for the specified resource. * - * @return the name value. + * @return the properties value. */ - String name(); + public SubscriptionQuotaAllocationsProperties properties() { + return this.properties; + } /** - * Gets the type property: The type of the resource. + * Set the properties property: Quota properties for the specified resource. * - * @return the type value. + * @param properties the properties value to set. + * @return the SubscriptionQuotaAllocations object itself. */ - String type(); + public SubscriptionQuotaAllocations withProperties(SubscriptionQuotaAllocationsProperties properties) { + this.properties = properties; + return this; + } /** - * Gets the properties property: Quota properties for the specified resource. + * Validates the instance. * - * @return the properties value. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - SubscriptionQuotaDetails properties(); + public void validate() { + if (properties() != null) { + properties().validate(); + } + } /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. + * {@inheritDoc} */ - SystemData systemData(); + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner object. + * Reads an instance of SubscriptionQuotaAllocations from the JsonReader. * - * @return the inner object. + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionQuotaAllocations 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 SubscriptionQuotaAllocations. */ - SubscriptionQuotaAllocationsInner innerModel(); + public static SubscriptionQuotaAllocations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionQuotaAllocations deserializedSubscriptionQuotaAllocations = new SubscriptionQuotaAllocations(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSubscriptionQuotaAllocations.properties + = SubscriptionQuotaAllocationsProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionQuotaAllocations; + }); + } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java index 3ec0e2f073dfa..f446f421570c0 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java @@ -4,114 +4,52 @@ package com.azure.resourcemanager.quota.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 com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; -import java.io.IOException; -import java.util.List; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; /** - * Subscription quota list. + * An immutable client-side representation of SubscriptionQuotaAllocationsList. */ -@Fluent -public final class SubscriptionQuotaAllocationsList implements JsonSerializable { - /* - * Subscription quota list. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of SubscriptionQuotaAllocationsList class. - */ - public SubscriptionQuotaAllocationsList() { - } - +public interface SubscriptionQuotaAllocationsList { /** - * Get the value property: Subscription quota list. + * Gets the id property: Fully qualified resource Id for the resource. * - * @return the value value. + * @return the id value. */ - public List value() { - return this.value; - } + String id(); /** - * Set the value property: Subscription quota list. + * Gets the name property: The name of the resource. * - * @param value the value value to set. - * @return the SubscriptionQuotaAllocationsList object itself. + * @return the name value. */ - public SubscriptionQuotaAllocationsList withValue(List value) { - this.value = value; - return this; - } + String name(); /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Gets the type property: The type of the resource. * - * @return the nextLink value. + * @return the type value. */ - public String nextLink() { - return this.nextLink; - } + String type(); /** - * Validates the instance. + * Gets the properties property: The properties property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the properties value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } + SubscriptionQuotaAllocationsListProperties properties(); /** - * {@inheritDoc} + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } + SystemData systemData(); /** - * Reads an instance of SubscriptionQuotaAllocationsList from the JsonReader. + * Gets the inner com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner object. * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocationsList 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 SubscriptionQuotaAllocationsList. + * @return the inner object. */ - public static SubscriptionQuotaAllocationsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocationsList deserializedSubscriptionQuotaAllocationsList - = new SubscriptionQuotaAllocationsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SubscriptionQuotaAllocationsInner.fromJson(reader1)); - deserializedSubscriptionQuotaAllocationsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocationsList; - }); - } + SubscriptionQuotaAllocationsListInner innerModel(); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java new file mode 100644 index 0000000000000..d04dcc4fb00f1 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.quota.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; + +/** + * The SubscriptionQuotaAllocationsListProperties model. + */ +@Fluent +public final class SubscriptionQuotaAllocationsListProperties + implements JsonSerializable { + /* + * Request status. + */ + private RequestState provisioningState; + + /* + * Subscription quota list. + */ + private List value; + + /* + * The URL to use for getting the next set of results. + */ + private String nextLink; + + /** + * Creates an instance of SubscriptionQuotaAllocationsListProperties class. + */ + public SubscriptionQuotaAllocationsListProperties() { + } + + /** + * Get the provisioningState property: Request status. + * + * @return the provisioningState value. + */ + public RequestState provisioningState() { + return this.provisioningState; + } + + /** + * Get the value property: Subscription quota list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Subscription quota list. + * + * @param value the value value to set. + * @return the SubscriptionQuotaAllocationsListProperties object itself. + */ + public SubscriptionQuotaAllocationsListProperties withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionQuotaAllocationsListProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionQuotaAllocationsListProperties 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 SubscriptionQuotaAllocationsListProperties. + */ + public static SubscriptionQuotaAllocationsListProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionQuotaAllocationsListProperties deserializedSubscriptionQuotaAllocationsListProperties + = new SubscriptionQuotaAllocationsListProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsListProperties.provisioningState + = RequestState.fromString(reader.getString()); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SubscriptionQuotaAllocations.fromJson(reader1)); + deserializedSubscriptionQuotaAllocationsListProperties.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsListProperties.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionQuotaAllocationsListProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java new file mode 100644 index 0000000000000..c8182f68cdb49 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaDetailsName; +import java.io.IOException; + +/** + * Quota properties for the specified resource. + */ +@Fluent +public final class SubscriptionQuotaAllocationsProperties extends SubscriptionQuotaDetails { + /* + * Name of the resource provided by the resource provider. This property is already included in the request URI, so + * it is a readonly property returned in the response. + */ + private SubscriptionQuotaDetailsName innerName; + + /* + * The shareable quota for the subscription. + */ + private Long shareableQuota; + + /** + * Creates an instance of SubscriptionQuotaAllocationsProperties class. + */ + public SubscriptionQuotaAllocationsProperties() { + } + + /** + * Get the innerName property: Name of the resource provided by the resource provider. This property is already + * included in the request URI, so it is a readonly property returned in the response. + * + * @return the innerName value. + */ + private SubscriptionQuotaDetailsName innerName() { + return this.innerName; + } + + /** + * Get the shareableQuota property: The shareable quota for the subscription. + * + * @return the shareableQuota value. + */ + @Override + public Long shareableQuota() { + return this.shareableQuota; + } + + /** + * {@inheritDoc} + */ + @Override + public SubscriptionQuotaAllocationsProperties withResourceName(String resourceName) { + super.withResourceName(resourceName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SubscriptionQuotaAllocationsProperties withLimit(Long limit) { + super.withLimit(limit); + return this; + } + + /** + * Get the value property: Resource name. + * + * @return the value value. + */ + public String value() { + return this.innerName() == null ? null : this.innerName().value(); + } + + /** + * Get the localizedValue property: Resource display name. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.innerName() == null ? null : this.innerName().localizedValue(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerName() != null) { + innerName().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceName", resourceName()); + jsonWriter.writeNumberField("limit", limit()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionQuotaAllocationsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionQuotaAllocationsProperties 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 SubscriptionQuotaAllocationsProperties. + */ + public static SubscriptionQuotaAllocationsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionQuotaAllocationsProperties deserializedSubscriptionQuotaAllocationsProperties + = new SubscriptionQuotaAllocationsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceName".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsProperties.withResourceName(reader.getString()); + } else if ("limit".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsProperties + .withLimit(reader.getNullable(JsonReader::getLong)); + } else if ("shareableQuota".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsProperties.shareableQuota + = reader.getNullable(JsonReader::getLong); + } else if ("name".equals(fieldName)) { + deserializedSubscriptionQuotaAllocationsProperties.innerName + = SubscriptionQuotaDetailsName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionQuotaAllocationsProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java index df65a8679c034..8f7a23d54b769 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java @@ -16,11 +16,11 @@ * Subscription Quota details. */ @Fluent -public final class SubscriptionQuotaDetails implements JsonSerializable { +public class SubscriptionQuotaDetails implements JsonSerializable { /* - * Location/Azure region for the quota requested for resource. + * The resource name, such as SKU name. */ - private String region; + private String resourceName; /* * The total quota limit for the subscription. @@ -45,22 +45,22 @@ public SubscriptionQuotaDetails() { } /** - * Get the region property: Location/Azure region for the quota requested for resource. + * Get the resourceName property: The resource name, such as SKU name. * - * @return the region value. + * @return the resourceName value. */ - public String region() { - return this.region; + public String resourceName() { + return this.resourceName; } /** - * Set the region property: Location/Azure region for the quota requested for resource. + * Set the resourceName property: The resource name, such as SKU name. * - * @param region the region value to set. + * @param resourceName the resourceName value to set. * @return the SubscriptionQuotaDetails object itself. */ - public SubscriptionQuotaDetails withRegion(String region) { - this.region = region; + public SubscriptionQuotaDetails withResourceName(String resourceName) { + this.resourceName = resourceName; return this; } @@ -93,6 +93,17 @@ public Long shareableQuota() { return this.shareableQuota; } + /** + * Set the shareableQuota property: The shareable quota for the subscription. + * + * @param shareableQuota the shareableQuota value to set. + * @return the SubscriptionQuotaDetails object itself. + */ + SubscriptionQuotaDetails withShareableQuota(Long shareableQuota) { + this.shareableQuota = shareableQuota; + return this; + } + /** * Get the innerName property: Name of the resource provided by the resource provider. This property is already * included in the request URI, so it is a readonly property returned in the response. @@ -103,6 +114,18 @@ private SubscriptionQuotaDetailsName innerName() { return this.innerName; } + /** + * Set the innerName property: Name of the resource provided by the resource provider. This property is already + * included in the request URI, so it is a readonly property returned in the response. + * + * @param innerName the innerName value to set. + * @return the SubscriptionQuotaDetails object itself. + */ + SubscriptionQuotaDetails withInnerName(SubscriptionQuotaDetailsName innerName) { + this.innerName = innerName; + return this; + } + /** * Get the value property: Resource name. * @@ -138,7 +161,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("resourceName", this.resourceName); jsonWriter.writeNumberField("limit", this.limit); return jsonWriter.writeEndObject(); } @@ -158,8 +181,8 @@ public static SubscriptionQuotaDetails fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("region".equals(fieldName)) { - deserializedSubscriptionQuotaDetails.region = reader.getString(); + if ("resourceName".equals(fieldName)) { + deserializedSubscriptionQuotaDetails.resourceName = reader.getString(); } else if ("limit".equals(fieldName)) { deserializedSubscriptionQuotaDetails.limit = reader.getNullable(JsonReader::getLong); } else if ("shareableQuota".equals(fieldName)) { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json index 903a9bbcceac9..f5544dc4bb7da 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json +++ b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsClientImpl$GroupQuotaLimitsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsClientImpl$GroupQuotaLimitsRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsClientImpl$GroupQuotaLocationSettingsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsClientImpl$GroupQuotaSubscriptionAllocationRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsClientImpl$GroupQuotaSubscriptionAllocationsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsClientImpl$GroupQuotaSubscriptionRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsClientImpl$GroupQuotaSubscriptionsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesClientImpl$GroupQuotaUsagesService"],["com.azure.resourcemanager.quota.implementation.GroupQuotasClientImpl$GroupQuotasService"],["com.azure.resourcemanager.quota.implementation.QuotaOperationsClientImpl$QuotaOperationsService"],["com.azure.resourcemanager.quota.implementation.QuotaRequestStatusClientImpl$QuotaRequestStatusService"],["com.azure.resourcemanager.quota.implementation.QuotasClientImpl$QuotasService"],["com.azure.resourcemanager.quota.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsClientImpl$GroupQuotaLimitsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsClientImpl$GroupQuotaLimitsRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsClientImpl$GroupQuotaSubscriptionAllocationRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsClientImpl$GroupQuotaSubscriptionAllocationsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsClientImpl$GroupQuotaSubscriptionRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsClientImpl$GroupQuotaSubscriptionsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotasClientImpl$GroupQuotasService"],["com.azure.resourcemanager.quota.implementation.QuotaOperationsClientImpl$QuotaOperationsService"],["com.azure.resourcemanager.quota.implementation.QuotaRequestStatusClientImpl$QuotaRequestStatusService"],["com.azure.resourcemanager.quota.implementation.QuotasClientImpl$QuotasService"],["com.azure.resourcemanager.quota.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetSamples.java deleted file mode 100644 index b376448b588a9..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetSamples.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.quota.generated; - -/** - * Samples for GroupQuotaLimits Get. - */ -public final class GroupQuotaLimitsGetSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimits/ - * GetGroupQuotaLimits-Compute.json - */ - /** - * Sample code: GroupQuotaLimits_Get_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLimitsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLimits() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "cores", - "location eq westus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java index 652cc1f9fa280..7732212a91e2c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java @@ -10,17 +10,17 @@ public final class GroupQuotaLimitsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimits/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimits/ * ListGroupQuotaLimits-Compute.json */ /** - * Sample code: GroupQuotaLimits_List_Request_ForCompute. + * Sample code: GroupQuotaLimits_Get_Request_ForCompute. * * @param manager Entry point to QuotaManager. */ - public static void groupQuotaLimitsListRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { + public static void groupQuotaLimitsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaLimits() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "location eq westus", + .listWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestCreateOrUpdateSamples.java deleted file mode 100644 index bd621a39a2f4e..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestCreateOrUpdateSamples.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.quota.generated; - -/** - * Samples for GroupQuotaLimitsRequest CreateOrUpdate. - */ -public final class GroupQuotaLimitsRequestCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /PutGroupQuotaLimitsRequests-Compute.json - */ - /** - * Sample code: GroupQuotaLimitsRequests_CreateOrUpdate. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLimitsRequestsCreateOrUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLimitsRequests() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - "standardav2family", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java index 16aee567b433f..88284214f5d85 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaLimitsRequestGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /GroupQuotaLimitsRequests_Get.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * GroupQuotaLimitsRequests_Get.json */ /** * Sample code: GroupQuotaLimitsRequests_Get. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java index 4ab250432703f..e9aafa9509509 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaLimitsRequestListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /GroupQuotaLimitsRequests_List.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * GroupQuotaLimitsRequests_List.json */ /** * Sample code: GroupQuotaLimitsRequest_List. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java index 826bad67ab46f..f7c12fd5419a6 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java @@ -4,14 +4,20 @@ package com.azure.resourcemanager.quota.generated; +import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; +import com.azure.resourcemanager.quota.models.GroupQuotaLimit; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; +import com.azure.resourcemanager.quota.models.GroupQuotaLimitProperties; +import java.util.Arrays; + /** * Samples for GroupQuotaLimitsRequest Update. */ public final class GroupQuotaLimitsRequestUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaLimitsRequests - * /PatchGroupQuotaLimitsRequests-Compute.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotaLimitsRequests/ + * PatchGroupQuotaLimitsRequests-Compute.json */ /** * Sample code: GroupQuotaLimitsRequests_Update. @@ -20,7 +26,17 @@ public final class GroupQuotaLimitsRequestUpdateSamples { */ public static void groupQuotaLimitsRequestsUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaLimitsRequests() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "standardav2family", - null, com.azure.core.util.Context.NONE); + .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", + new GroupQuotaLimitListInner() + .withProperties(new GroupQuotaLimitListProperties().withValue(Arrays.asList( + new GroupQuotaLimit() + .withProperties(new GroupQuotaLimitProperties().withResourceName("standardddv4family") + .withLimit(110L) + .withComment("Contoso requires more quota.")), + new GroupQuotaLimit() + .withProperties(new GroupQuotaLimitProperties().withResourceName("standardav2family") + .withLimit(110L) + .withComment("Contoso requires more quota."))))), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java deleted file mode 100644 index 125e3a29f25b1..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.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.quota.generated; - -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.EnforcementState; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; - -/** - * Samples for GroupQuotaLocationSettings CreateOrUpdate. - */ -public final class GroupQuotaLocationSettingsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PutGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaLocationSettings_CreateOrUpdate. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLocationSettingsCreateOrUpdate(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PutGroupQuotaEnforcementFailed.json - */ - /** - * Sample code: GroupQuotaLocationSettings_CreateOrUpdate_Failed. - * - * @param manager Entry point to QuotaManager. - */ - public static void - groupQuotaLocationSettingsCreateOrUpdateFailed(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java deleted file mode 100644 index 1cf7154503274..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.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.quota.generated; - -/** - * Samples for GroupQuotaLocationSettings Get. - */ -public final class GroupQuotaLocationSettingsGetSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * GetGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotasEnforcement_Get. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotasEnforcementGet(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsListSamples.java deleted file mode 100644 index 32b5976383ef6..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsListSamples.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.quota.generated; - -/** - * Samples for GroupQuotaLocationSettings List. - */ -public final class GroupQuotaLocationSettingsListSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * ListGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaEnforcement_List. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaEnforcementList(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java deleted file mode 100644 index 46f2630df3870..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementResponseInner; -import com.azure.resourcemanager.quota.models.EnforcementState; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementResponseProperties; - -/** - * Samples for GroupQuotaLocationSettings Update. - */ -public final class GroupQuotaLocationSettingsUpdateSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasEnforcement/ - * PatchGroupQuotaEnforcement.json - */ - /** - * Sample code: GroupQuotaLocationSettings_Patch. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotaLocationSettingsPatch(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaLocationSettings() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "eastus", - new GroupQuotasEnforcementResponseInner().withProperties( - new GroupQuotasEnforcementResponseProperties().withEnforcementEnabled(EnforcementState.ENABLED)), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationGetSamples.java deleted file mode 100644 index 6b538983f5194..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationGetSamples.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.quota.generated; - -/** - * Samples for GroupQuotaSubscriptionAllocation Get. - */ -public final class GroupQuotaSubscriptionAllocationGetSamples { - /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_Get-Compute.json - */ - /** - * Sample code: SubscriptionQuotaAllocation_Get_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void - subscriptionQuotaAllocationGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaSubscriptionAllocations() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "standardav2family", - "provider eq Microsoft.Compute & location eq westus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java index a21215305c68f..d6f6b11a799ed 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java @@ -9,8 +9,9 @@ */ public final class GroupQuotaSubscriptionAllocationListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionQuotaAllocation/ + * SubscriptionQuotaAllocation_List-Compute.json */ /** * Sample code: SubscriptionQuotaAllocation_List_ForCompute. @@ -19,7 +20,7 @@ public final class GroupQuotaSubscriptionAllocationListSamples { */ public static void subscriptionQuotaAllocationListForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocations() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", - "provider eq Microsoft.Compute & location eq westus", com.azure.core.util.Context.NONE); + .listWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples.java deleted file mode 100644 index 6ecc5c98264b8..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; - -/** - * Samples for GroupQuotaSubscriptionAllocationRequest CreateOrUpdate. - */ -public final class GroupQuotaSubscriptionAllocationRequestCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * SubscriptionQuotaAllocationRequests/PutSubscriptionQuotaAllocationRequest-Compute.json - */ - /** - * Sample code: SubscriptionQuotaAllocation_Put_Request_ForCompute. - * - * @param manager Entry point to QuotaManager. - */ - public static void - subscriptionQuotaAllocationPutRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaSubscriptionAllocationRequests() - .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", - "standardav2family", - new QuotaAllocationRequestStatusInner() - .withRequestedResource(new QuotaAllocationRequestBase().withLimit(10L).withRegion("westus")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java index d2cce84c19ac3..9f2fb7d184d12 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json */ /** @@ -20,7 +20,7 @@ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { public static void subscriptionQuotaAllocationRequestsGetRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocationRequests() - .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", + .getWithResponse("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "AE000000-0000-0000-0000-00000000000A", com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java index fa0040f7ac97f..cf8b88a5436e5 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionAllocationRequestListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json */ /** diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java index bcc3a310f4739..c3facee0d3af3 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java @@ -4,15 +4,18 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; +import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; +import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsProperties; +import java.util.Arrays; /** * Samples for GroupQuotaSubscriptionAllocationRequest Update. */ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json */ /** @@ -23,9 +26,15 @@ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { public static void subscriptionQuotaAllocationPatchRequestForCompute(com.azure.resourcemanager.quota.QuotaManager manager) { manager.groupQuotaSubscriptionAllocationRequests() - .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "standardav2family", - new QuotaAllocationRequestStatusInner() - .withRequestedResource(new QuotaAllocationRequestBase().withLimit(10L).withRegion("westus")), + .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", + new SubscriptionQuotaAllocationsListInner() + .withProperties(new SubscriptionQuotaAllocationsListProperties().withValue(Arrays.asList( + new SubscriptionQuotaAllocations().withProperties( + new SubscriptionQuotaAllocationsProperties().withResourceName("standardddv4family") + .withLimit(110L)), + new SubscriptionQuotaAllocations().withProperties( + new SubscriptionQuotaAllocationsProperties().withResourceName("standardav2family") + .withLimit(110L))))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java index 474528e4099a2..81cd3e59c5e13 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java @@ -10,7 +10,7 @@ public final class GroupQuotaSubscriptionRequestsGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionRequests/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionRequests/ * SubscriptionRequests_Get.json */ /** diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java index 32fc6c62ad65f..65eeff2f02cf1 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java @@ -10,7 +10,7 @@ public final class GroupQuotaSubscriptionRequestsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/SubscriptionRequests/ + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/SubscriptionRequests/ * SubscriptionRequests_List.json */ /** diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java index b6fbb156487e2..ec8d20f07b87c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /PutGroupQuotasSubscription.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * PutGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Put_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java index 572733e2dd011..717101ac6dd09 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaSubscriptionsDeleteSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /DeleteGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * DeleteGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Delete_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java index 3c558d8fe8600..a7859f4aa367a 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaSubscriptionsGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /GetGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * GetGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Get_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java index 0ee733f9b600b..18dfdd9fd95a1 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaSubscriptionsListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /ListGroupQuotaSubscriptions.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * ListGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_List_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java index 335a5ae6a721a..a6e0098b9055b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotaSubscriptionsUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotasSubscriptions - * /PatchGroupQuotasSubscription.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotasSubscriptions/ + * PatchGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Patch_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java deleted file mode 100644 index 4903304f869ca..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.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.quota.generated; - -/** - * Samples for GroupQuotaUsages List. - */ -public final class GroupQuotaUsagesListSamples { - /* - * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotaUsages/ - * GetGroupQuotaUsages.json - */ - /** - * Sample code: GroupQuotasUsages_List. - * - * @param manager Entry point to QuotaManager. - */ - public static void groupQuotasUsagesList(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.groupQuotaUsages() - .list("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", "Microsoft.Compute", "westus", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java index 9eb308aad0592..8e527b54c3239 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java @@ -5,11 +5,7 @@ package com.azure.resourcemanager.quota.generated; import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; /** * Samples for GroupQuotas CreateOrUpdate. @@ -17,8 +13,7 @@ public final class GroupQuotasCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * PutGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/PutGroupQuotas.json */ /** * Sample code: GroupQuotas_Put_Request_ForCompute. @@ -29,13 +24,7 @@ public static void groupQuotasPutRequestForCompute(com.azure.resourcemanager.quo manager.groupQuotas() .createOrUpdate("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", new GroupQuotasEntityInner() - .withProperties( - new GroupQuotasEntityBase().withDisplayName("GroupQuota1") - .withAdditionalAttributes( - new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID) - .withValue("yourServiceTreeIdHere")) - .withEnvironment(EnvironmentType.PRODUCTION))), + .withProperties(new GroupQuotasEntityProperties().withDisplayName("GroupQuota1")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java index 98033f68e8aee..88c815e49ac40 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotasDeleteSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * DeleteGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/DeleteGroupQuotas. + * json */ /** * Sample code: GroupQuotas_Delete_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java index 20b415b86f8bd..460dc3a734e36 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java @@ -10,8 +10,7 @@ public final class GroupQuotasGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * GetGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/GetGroupQuotas.json */ /** * Sample code: GroupQuotas_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java index fc7b473e49e4f..eef62fdcf278b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java @@ -10,8 +10,8 @@ public final class GroupQuotasListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * GetGroupQuotasList.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/GetGroupQuotasList. + * json */ /** * Sample code: GroupQuotas_List_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java index cc92164179ba6..e77319fcbd3f2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java @@ -4,12 +4,8 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBasePatch; import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; +import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatchProperties; /** * Samples for GroupQuotas Update. @@ -17,8 +13,7 @@ public final class GroupQuotasUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GroupQuotas/ - * PatchGroupQuotas.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GroupQuotas/PatchGroupQuotas.json */ /** * Sample code: GroupQuotas_Patch_Request_ForCompute. @@ -29,12 +24,7 @@ public static void groupQuotasPatchRequestForCompute(com.azure.resourcemanager.q manager.groupQuotas() .update("E7EC67B3-7657-4966-BFFC-41EFD36BAA09", "groupquota1", new GroupQuotasEntityPatch() - .withProperties( - new GroupQuotasEntityBasePatch().withDisplayName("UpdatedGroupQuota1") - .withAdditionalAttributes(new AdditionalAttributesPatch() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID) - .withValue("UpdatedServiceTreeIdHere")) - .withEnvironment(EnvironmentType.PRODUCTION))), + .withProperties(new GroupQuotasEntityPatchProperties().withDisplayName("UpdatedGroupQuota1")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java index fdc58ef3fa559..a16a9f8bcf294 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * putMachineLearningServicesQuotaRequestLowPriority.json */ /** @@ -34,7 +34,7 @@ public static void quotasRequestForMachineLearningServicesLowPriorityResource( } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json */ /** @@ -55,8 +55,8 @@ public static void quotasPutRequestForNetworkStandardSkuPublicIpAddressesResourc } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * putComputeOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Put_Request_ForCompute. @@ -74,8 +74,8 @@ public static void quotasPutRequestForCompute(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * putNetworkOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/putNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_PutRequest_ForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java index c8475fb6b723c..8ac7a33e834ca 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java @@ -9,8 +9,8 @@ */ public final class QuotaGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getNetworkOneSkuQuotaLimit.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkOneSkuQuotaLimit.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -25,8 +25,8 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getComputeOneSkuQuotaLimit.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeOneSkuQuotaLimit.json */ /** * Sample code: Quotas_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java index 8b73cf9fb7fd1..814c33c1ab593 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/ * getMachineLearningServicesQuotaLimits.json */ /** @@ -27,8 +27,7 @@ public final class QuotaListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeQuotaLimits. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForCompute. @@ -43,8 +42,7 @@ public static void quotasListQuotaLimitsForCompute(com.azure.resourcemanager.quo /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkQuotaLimits. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java index 2cecef0fa85b5..eb19f0534da65 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java @@ -10,7 +10,7 @@ public final class QuotaOperationListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/GetOperations.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/GetOperations.json */ /** * Sample code: GetOperations. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java index ce791ab8ad175..6021df63448cb 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java @@ -9,8 +9,8 @@ */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusFailed.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -25,8 +25,8 @@ public static void quotaRequestFailed(com.azure.resourcemanager.quota.QuotaManag } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusById.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -41,8 +41,9 @@ public static void quotaRequestStatus(com.azure.resourcemanager.quota.QuotaManag } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getQuotaRequestStatusInProgress.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestStatusInProgress. + * json */ /** * Sample code: QuotaRequestInProgress. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java index 6b8deb9785bf0..124aa32d83283 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java @@ -10,8 +10,7 @@ public final class QuotaRequestStatusListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getQuotaRequestsHistory. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java index 4ac488b74e6e2..3d417bd68afca 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java @@ -15,8 +15,7 @@ public final class QuotaUpdateSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/patchComputeQuotaRequest - * .json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -36,8 +35,9 @@ public static void quotasRequestPatchForCompute(com.azure.resourcemanager.quota. } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * patchNetworkOneSkuQuotaRequest.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/patchNetworkOneSkuQuotaRequest. + * json */ /** * Sample code: Quotas_Request_PatchForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java index e02cc3557b333..7e217210292e7 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java @@ -10,8 +10,7 @@ public final class UsagesGetSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkOneSkuUsages. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -27,8 +26,7 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeOneSkuUsages. - * json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java index 6c1a7c7fb16a0..fb837ac1648ba 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java @@ -10,7 +10,7 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getComputeUsages.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -25,7 +25,7 @@ public static void quotasListUsagesForCompute(com.azure.resourcemanager.quota.Qu /* * x-ms-original-file: - * specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/getNetworkUsages.json + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getNetworkUsages.json */ /** * Sample code: Quotas_listUsagesForNetwork. @@ -39,8 +39,9 @@ public static void quotasListUsagesForNetwork(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2023-06-01-preview/examples/ - * getMachineLearningServicesUsages.json + * x-ms-original-file: + * specification/quota/resource-manager/Microsoft.Quota/stable/2024-12-12/examples/getMachineLearningServicesUsages. + * json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesPatchTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesPatchTests.java deleted file mode 100644 index 8a834404261b9..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesPatchTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class AdditionalAttributesPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalAttributesPatch model = BinaryData.fromString( - "{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"usarhmofc\"},\"environment\":\"NonProduction\"}") - .toObject(AdditionalAttributesPatch.class); - Assertions.assertEquals(GroupingIdType.BILLING_ID, model.groupId().groupingIdType()); - Assertions.assertEquals("usarhmofc", model.groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, model.environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalAttributesPatch model = new AdditionalAttributesPatch() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID).withValue("usarhmofc")) - .withEnvironment(EnvironmentType.NON_PRODUCTION); - model = BinaryData.fromObject(model).toObject(AdditionalAttributesPatch.class); - Assertions.assertEquals(GroupingIdType.BILLING_ID, model.groupId().groupingIdType()); - Assertions.assertEquals("usarhmofc", model.groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, model.environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesTests.java deleted file mode 100644 index 57dd660b9a2ed..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AdditionalAttributesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class AdditionalAttributesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalAttributes model = BinaryData.fromString( - "{\"groupId\":{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"gkdmb\"},\"environment\":\"Production\"}") - .toObject(AdditionalAttributes.class); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, model.groupId().groupingIdType()); - Assertions.assertEquals("gkdmb", model.groupId().value()); - Assertions.assertEquals(EnvironmentType.PRODUCTION, model.environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalAttributes model = new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("gkdmb")) - .withEnvironment(EnvironmentType.PRODUCTION); - model = BinaryData.fromObject(model).toObject(AdditionalAttributes.class); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, model.groupId().groupingIdType()); - Assertions.assertEquals("gkdmb", model.groupId().value()); - Assertions.assertEquals(EnvironmentType.PRODUCTION, model.environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedQuotaToSubscriptionListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedQuotaToSubscriptionListTests.java deleted file mode 100644 index a887c013d16e0..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedQuotaToSubscriptionListTests.java +++ /dev/null @@ -1,34 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AllocatedQuotaToSubscriptionList; -import com.azure.resourcemanager.quota.models.AllocatedToSubscription; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AllocatedQuotaToSubscriptionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllocatedQuotaToSubscriptionList model = BinaryData.fromString( - "{\"value\":[{\"subscriptionId\":\"qw\",\"quotaAllocated\":1046762399333359388},{\"subscriptionId\":\"bbjfddgmbmbexp\",\"quotaAllocated\":313278106119438402},{\"subscriptionId\":\"qrolfpf\",\"quotaAllocated\":5108229152426032776},{\"subscriptionId\":\"bquxigjy\",\"quotaAllocated\":3662129632751771998}]}") - .toObject(AllocatedQuotaToSubscriptionList.class); - Assertions.assertEquals("qw", model.value().get(0).subscriptionId()); - Assertions.assertEquals(1046762399333359388L, model.value().get(0).quotaAllocated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllocatedQuotaToSubscriptionList model = new AllocatedQuotaToSubscriptionList().withValue(Arrays.asList( - new AllocatedToSubscription().withSubscriptionId("qw").withQuotaAllocated(1046762399333359388L), - new AllocatedToSubscription().withSubscriptionId("bbjfddgmbmbexp").withQuotaAllocated(313278106119438402L), - new AllocatedToSubscription().withSubscriptionId("qrolfpf").withQuotaAllocated(5108229152426032776L), - new AllocatedToSubscription().withSubscriptionId("bquxigjy").withQuotaAllocated(3662129632751771998L))); - model = BinaryData.fromObject(model).toObject(AllocatedQuotaToSubscriptionList.class); - Assertions.assertEquals("qw", model.value().get(0).subscriptionId()); - Assertions.assertEquals(1046762399333359388L, model.value().get(0).quotaAllocated()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedToSubscriptionTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedToSubscriptionTests.java deleted file mode 100644 index bf7fd5d83d740..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/AllocatedToSubscriptionTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AllocatedToSubscription; -import org.junit.jupiter.api.Assertions; - -public final class AllocatedToSubscriptionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllocatedToSubscription model - = BinaryData.fromString("{\"subscriptionId\":\"o\",\"quotaAllocated\":1618958611063103358}") - .toObject(AllocatedToSubscription.class); - Assertions.assertEquals("o", model.subscriptionId()); - Assertions.assertEquals(1618958611063103358L, model.quotaAllocated()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllocatedToSubscription model - = new AllocatedToSubscription().withSubscriptionId("o").withQuotaAllocated(1618958611063103358L); - model = BinaryData.fromObject(model).toObject(AllocatedToSubscription.class); - Assertions.assertEquals("o", model.subscriptionId()); - Assertions.assertEquals(1618958611063103358L, model.quotaAllocated()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentQuotaLimitBaseInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentQuotaLimitBaseInnerTests.java deleted file mode 100644 index 34e2c03512bfb..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentQuotaLimitBaseInnerTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.models.LimitJsonObject; -import com.azure.resourcemanager.quota.models.QuotaProperties; -import com.azure.resourcemanager.quota.models.ResourceName; -import org.junit.jupiter.api.Assertions; - -public final class CurrentQuotaLimitBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CurrentQuotaLimitBaseInner model = BinaryData.fromString( - "{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"qzrnkcqvyxlwhz\",\"name\":{\"value\":\"cohoq\",\"localizedValue\":\"wvl\"},\"resourceType\":\"avwhheunm\",\"quotaPeriod\":\"hgyxzkonoc\",\"isQuotaApplicable\":true,\"properties\":\"datalyaxuc\"},\"id\":\"nuqszfkbey\",\"name\":\"ewrmjmwvvjektc\",\"type\":\"senhwlrs\"}") - .toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals("cohoq", model.properties().name().value()); - Assertions.assertEquals("avwhheunm", model.properties().resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CurrentQuotaLimitBaseInner model - = new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("cohoq")) - .withResourceType("avwhheunm") - .withProperties("datalyaxuc")); - model = BinaryData.fromObject(model).toObject(CurrentQuotaLimitBaseInner.class); - Assertions.assertEquals("cohoq", model.properties().name().value()); - Assertions.assertEquals("avwhheunm", model.properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentUsagesBaseInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentUsagesBaseInnerTests.java deleted file mode 100644 index 87fd833753a89..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CurrentUsagesBaseInnerTests.java +++ /dev/null @@ -1,40 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.models.ResourceName; -import com.azure.resourcemanager.quota.models.UsagesObject; -import com.azure.resourcemanager.quota.models.UsagesProperties; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import org.junit.jupiter.api.Assertions; - -public final class CurrentUsagesBaseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CurrentUsagesBaseInner model = BinaryData.fromString( - "{\"properties\":{\"usages\":{\"value\":206207279,\"usagesType\":\"Combined\"},\"unit\":\"hrk\",\"name\":{\"value\":\"wwzjuqkhrsajiwku\",\"localizedValue\":\"oskg\"},\"resourceType\":\"auu\",\"quotaPeriod\":\"jmvxie\",\"isQuotaApplicable\":false,\"properties\":\"dataidyjrrfbyaosvexc\"},\"id\":\"onpc\",\"name\":\"hocohslkev\",\"type\":\"eggzfb\"}") - .toObject(CurrentUsagesBaseInner.class); - Assertions.assertEquals(206207279, model.properties().usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.properties().usages().usagesType()); - Assertions.assertEquals("wwzjuqkhrsajiwku", model.properties().name().value()); - Assertions.assertEquals("auu", model.properties().resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CurrentUsagesBaseInner model = new CurrentUsagesBaseInner().withProperties(new UsagesProperties() - .withUsages(new UsagesObject().withValue(206207279).withUsagesType(UsagesTypes.COMBINED)) - .withName(new ResourceName().withValue("wwzjuqkhrsajiwku")) - .withResourceType("auu") - .withProperties("dataidyjrrfbyaosvexc")); - model = BinaryData.fromObject(model).toObject(CurrentUsagesBaseInner.class); - Assertions.assertEquals(206207279, model.properties().usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.properties().usages().usagesType()); - Assertions.assertEquals("wwzjuqkhrsajiwku", model.properties().name().value()); - Assertions.assertEquals("auu", model.properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsNameTests.java deleted file mode 100644 index 3d262447e5cbe..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaDetailsName; - -public final class GroupQuotaDetailsNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaDetailsName model - = BinaryData.fromString("{\"value\":\"kwtmutduqktapspw\",\"localizedValue\":\"uertumk\"}") - .toObject(GroupQuotaDetailsName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaDetailsName model = new GroupQuotaDetailsName(); - model = BinaryData.fromObject(model).toObject(GroupQuotaDetailsName.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsTests.java deleted file mode 100644 index f349cc0dacc46..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaDetailsTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupQuotaDetails; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaDetails model = BinaryData.fromString( - "{\"region\":\"yxolniwp\",\"limit\":4659788042682990061,\"comment\":\"fkgiawxk\",\"name\":{\"value\":\"plwckbas\",\"localizedValue\":\"pnddhsgcbacphejk\"},\"unit\":\"ynqgoulzndlikwyq\",\"availableLimit\":3834014588009600234,\"allocatedToSubscriptions\":{\"value\":[{\"subscriptionId\":\"dgak\",\"quotaAllocated\":801620479699597544},{\"subscriptionId\":\"yb\",\"quotaAllocated\":7229748892246039848},{\"subscriptionId\":\"qytbciq\",\"quotaAllocated\":5348039389469426548},{\"subscriptionId\":\"mmnkzsmodmgl\",\"quotaAllocated\":800844315358769757}]}}") - .toObject(GroupQuotaDetails.class); - Assertions.assertEquals("yxolniwp", model.region()); - Assertions.assertEquals(4659788042682990061L, model.limit()); - Assertions.assertEquals("fkgiawxk", model.comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaDetails model - = new GroupQuotaDetails().withRegion("yxolniwp").withLimit(4659788042682990061L).withComment("fkgiawxk"); - model = BinaryData.fromObject(model).toObject(GroupQuotaDetails.class); - Assertions.assertEquals("yxolniwp", model.region()); - Assertions.assertEquals(4659788042682990061L, model.limit()); - Assertions.assertEquals("fkgiawxk", model.comment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitInnerTests.java deleted file mode 100644 index f48c8ad94a063..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitInnerTests.java +++ /dev/null @@ -1,34 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import com.azure.resourcemanager.quota.models.GroupQuotaDetails; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaLimitInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaLimitInner model = BinaryData.fromString( - "{\"properties\":{\"region\":\"lljfmppeeb\",\"limit\":8706154927582120085,\"comment\":\"abkyqduujitcjcz\",\"name\":{\"value\":\"vndhkrwpdapp\",\"localizedValue\":\"bdkvwrwjf\"},\"unit\":\"snhu\",\"availableLimit\":8316497364859549457,\"allocatedToSubscriptions\":{\"value\":[{\"subscriptionId\":\"dhugjzzdatqxhocd\",\"quotaAllocated\":6124720690477162345}]}},\"id\":\"gphuticndvka\",\"name\":\"zwyiftyhxhur\",\"type\":\"k\"}") - .toObject(GroupQuotaLimitInner.class); - Assertions.assertEquals("lljfmppeeb", model.properties().region()); - Assertions.assertEquals(8706154927582120085L, model.properties().limit()); - Assertions.assertEquals("abkyqduujitcjcz", model.properties().comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaLimitInner model - = new GroupQuotaLimitInner().withProperties(new GroupQuotaDetails().withRegion("lljfmppeeb") - .withLimit(8706154927582120085L) - .withComment("abkyqduujitcjcz")); - model = BinaryData.fromObject(model).toObject(GroupQuotaLimitInner.class); - Assertions.assertEquals("lljfmppeeb", model.properties().region()); - Assertions.assertEquals(8706154927582120085L, model.properties().limit()); - Assertions.assertEquals("abkyqduujitcjcz", model.properties().comment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitListTests.java deleted file mode 100644 index 115d352cc9605..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitListTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitInner; -import com.azure.resourcemanager.quota.models.GroupQuotaDetails; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaLimitListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaLimitList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"region\":\"n\",\"limit\":5477626889722442552,\"comment\":\"ysvlejuvf\",\"name\":{\"value\":\"rlyxwjkcprbnw\",\"localizedValue\":\"gjvtbv\"},\"unit\":\"sszdnru\",\"availableLimit\":3086796418296040300,\"allocatedToSubscriptions\":{\"value\":[{}]}},\"id\":\"uqfprwzw\",\"name\":\"nguitnwuizgazxu\",\"type\":\"izuckyfihrfidfvz\"},{\"properties\":{\"region\":\"uht\",\"limit\":7093196131799680709,\"comment\":\"dkfthwxmnt\",\"name\":{\"value\":\"aop\",\"localizedValue\":\"mijcmmxdcufufs\"},\"unit\":\"ymzidn\",\"availableLimit\":6857493203334050846,\"allocatedToSubscriptions\":{\"value\":[{},{},{}]}},\"id\":\"sgfyccsnew\",\"name\":\"dwzjeiach\",\"type\":\"oosflnr\"}],\"nextLink\":\"fqpte\"}") - .toObject(GroupQuotaLimitList.class); - Assertions.assertEquals("n", model.value().get(0).properties().region()); - Assertions.assertEquals(5477626889722442552L, model.value().get(0).properties().limit()); - Assertions.assertEquals("ysvlejuvf", model.value().get(0).properties().comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaLimitList model = new GroupQuotaLimitList().withValue(Arrays.asList( - new GroupQuotaLimitInner().withProperties( - new GroupQuotaDetails().withRegion("n").withLimit(5477626889722442552L).withComment("ysvlejuvf")), - new GroupQuotaLimitInner().withProperties( - new GroupQuotaDetails().withRegion("uht").withLimit(7093196131799680709L).withComment("dkfthwxmnt")))); - model = BinaryData.fromObject(model).toObject(GroupQuotaLimitList.class); - Assertions.assertEquals("n", model.value().get(0).properties().region()); - Assertions.assertEquals(5477626889722442552L, model.value().get(0).properties().limit()); - Assertions.assertEquals("ysvlejuvf", model.value().get(0).properties().comment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetWithResponseMockTests.java deleted file mode 100644 index 93fe192951fd5..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsGetWithResponseMockTests.java +++ /dev/null @@ -1,42 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaLimit; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaLimitsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"region\":\"nayqi\",\"limit\":6131994767406394779,\"comment\":\"havhqlkthumaqolb\",\"name\":{\"value\":\"duiertgcc\",\"localizedValue\":\"vaolpsslqlf\"},\"unit\":\"dnbbglzps\",\"availableLimit\":5564635396435851396,\"allocatedToSubscriptions\":{\"value\":[{\"subscriptionId\":\"hzdxssadbzm\",\"quotaAllocated\":2094895457348601171},{\"subscriptionId\":\"n\",\"quotaAllocated\":1939763512135424116}]}},\"id\":\"vxzbncb\",\"name\":\"ylpstdbhhxsrzdz\",\"type\":\"cers\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotaLimit response = manager.groupQuotaLimits() - .getWithResponse("taruoujmkcj", "wqytjrybnwjewgdr", "ervnaenqpehi", "doy", "mifthnzdnd", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nayqi", response.properties().region()); - Assertions.assertEquals(6131994767406394779L, response.properties().limit()); - Assertions.assertEquals("havhqlkthumaqolb", response.properties().comment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListMockTests.java deleted file mode 100644 index 8e6a56f2e324e..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaLimit; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaLimitsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"region\":\"weriofzpyqsem\",\"limit\":7559264864950811898,\"comment\":\"tshhszhedp\",\"name\":{\"value\":\"iwubmwmbesldnk\",\"localizedValue\":\"tppjflcx\"},\"unit\":\"aokonzmnsik\",\"availableLimit\":4352288907832795001,\"allocatedToSubscriptions\":{\"value\":[{\"subscriptionId\":\"kdltfzxmhhvhg\",\"quotaAllocated\":1046388892732212968},{\"subscriptionId\":\"kwobdagxtibq\",\"quotaAllocated\":8983172465678034803},{\"subscriptionId\":\"akbogqxndlkzgxh\",\"quotaAllocated\":8267760773772711252},{\"subscriptionId\":\"bpodxunkbebxm\",\"quotaAllocated\":5789185793221344217}]}},\"id\":\"twlrbqt\",\"name\":\"oievseotgqrlltm\",\"type\":\"wlauwzizxbmpg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.groupQuotaLimits().list("dntnevf", "wjmy", "tdss", "s", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("weriofzpyqsem", response.iterator().next().properties().region()); - Assertions.assertEquals(7559264864950811898L, response.iterator().next().properties().limit()); - Assertions.assertEquals("tshhszhedp", response.iterator().next().properties().comment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaListTests.java deleted file mode 100644 index 2743561f2fde2..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaListTests.java +++ /dev/null @@ -1,72 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotaList; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"kdtmlxhekuk\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"kc\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ryuanzwuxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"},{\"properties\":{\"displayName\":\"ryrtihfxtijbpzv\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"ymglzufcyz\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Invalid\"},\"id\":\"hanufhfcbjysagi\",\"name\":\"hxqh\",\"type\":\"bifpikxwczb\"},{\"properties\":{\"displayName\":\"npqxuh\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"iwbybrkxvdumjg\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"InProgress\"},\"id\":\"k\",\"name\":\"gaudcc\",\"type\":\"nhsjcnyej\"},{\"properties\":{\"displayName\":\"yhtnapczwlokjye\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"ipjoxzjnchgejs\"},\"environment\":\"Production\"},\"provisioningState\":\"Accepted\"},\"id\":\"lzydehojwyahux\",\"name\":\"npmqnjaqwixjspro\",\"type\":\"vcputegj\"}],\"nextLink\":\"mfdatscmdvpj\"}") - .toObject(GroupQuotaList.class); - Assertions.assertEquals("kdtmlxhekuk", model.value().get(0).properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.value().get(0).properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("kc", model.value().get(0).properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.value().get(0).properties().additionalAttributes().environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaList model - = new GroupQuotaList() - .withValue( - Arrays.asList( - new GroupQuotasEntityInner() - .withProperties(new GroupQuotasEntityBase().withDisplayName("kdtmlxhekuk") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId( - new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID).withValue("kc")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))), - new GroupQuotasEntityInner().withProperties(new GroupQuotasEntityBase() - .withDisplayName("ryrtihfxtijbpzv") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID) - .withValue("ymglzufcyz")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))), - new GroupQuotasEntityInner() - .withProperties( - new GroupQuotasEntityBase().withDisplayName("npqxuh") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID) - .withValue("iwbybrkxvdumjg")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))), - new GroupQuotasEntityInner() - .withProperties( - new GroupQuotasEntityBase().withDisplayName("yhtnapczwlokjye") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID) - .withValue("ipjoxzjnchgejs")) - .withEnvironment(EnvironmentType.PRODUCTION))))); - model = BinaryData.fromObject(model).toObject(GroupQuotaList.class); - Assertions.assertEquals("kdtmlxhekuk", model.value().get(0).properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.value().get(0).properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("kc", model.value().get(0).properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.value().get(0).properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesNameTests.java deleted file mode 100644 index 03e3233947bee..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaRequestBasePropertiesName; - -public final class GroupQuotaRequestBasePropertiesNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaRequestBasePropertiesName model - = BinaryData.fromString("{\"value\":\"npime\",\"localizedValue\":\"stxgc\"}") - .toObject(GroupQuotaRequestBasePropertiesName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaRequestBasePropertiesName model = new GroupQuotaRequestBasePropertiesName(); - model = BinaryData.fromObject(model).toObject(GroupQuotaRequestBasePropertiesName.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesTests.java deleted file mode 100644 index 999b3cc22ecd0..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBasePropertiesTests.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaRequestBaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaRequestBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaRequestBaseProperties model = BinaryData.fromString( - "{\"limit\":7208610995998070397,\"name\":{\"value\":\"c\",\"localizedValue\":\"ierhhbcsglummaj\"},\"region\":\"aodxo\",\"comments\":\"bdxkqpxokaj\"}") - .toObject(GroupQuotaRequestBaseProperties.class); - Assertions.assertEquals(7208610995998070397L, model.limit()); - Assertions.assertEquals("aodxo", model.region()); - Assertions.assertEquals("bdxkqpxokaj", model.comments()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaRequestBaseProperties model = new GroupQuotaRequestBaseProperties().withLimit(7208610995998070397L) - .withRegion("aodxo") - .withComments("bdxkqpxokaj"); - model = BinaryData.fromObject(model).toObject(GroupQuotaRequestBaseProperties.class); - Assertions.assertEquals(7208610995998070397L, model.limit()); - Assertions.assertEquals("aodxo", model.region()); - Assertions.assertEquals("bdxkqpxokaj", model.comments()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBaseTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBaseTests.java deleted file mode 100644 index 64eeddc10a566..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaRequestBaseTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupQuotaRequestBase; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaRequestBase model = BinaryData.fromString( - "{\"properties\":{\"limit\":270477454684900932,\"name\":{\"value\":\"ajzyul\",\"localizedValue\":\"u\"},\"region\":\"krlkhbzhfepg\",\"comments\":\"qex\"}}") - .toObject(GroupQuotaRequestBase.class); - Assertions.assertEquals(270477454684900932L, model.limit()); - Assertions.assertEquals("krlkhbzhfepg", model.region()); - Assertions.assertEquals("qex", model.comments()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaRequestBase model - = new GroupQuotaRequestBase().withLimit(270477454684900932L).withRegion("krlkhbzhfepg").withComments("qex"); - model = BinaryData.fromObject(model).toObject(GroupQuotaRequestBase.class); - Assertions.assertEquals(270477454684900932L, model.limit()); - Assertions.assertEquals("krlkhbzhfepg", model.region()); - Assertions.assertEquals("qex", model.comments()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsGetWithResponseMockTests.java deleted file mode 100644 index fdadf2494a999..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionAllocationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"region\":\"ywsuwsy\",\"limit\":859811408175724714,\"shareableQuota\":6260637349305399844,\"name\":{\"value\":\"dgvraeaeneq\",\"localizedValue\":\"arrwlquu\"}},\"id\":\"fqka\",\"name\":\"e\",\"type\":\"iipfpubj\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SubscriptionQuotaAllocations response = manager.groupQuotaSubscriptionAllocations() - .getWithResponse("joxafnndlpi", "hkoymkcdyhbp", "kpw", "reqnovvqfov", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ywsuwsy", response.properties().region()); - Assertions.assertEquals(859811408175724714L, response.properties().limit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsListMockTests.java deleted file mode 100644 index 2598b551ec69c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationsListMockTests.java +++ /dev/null @@ -1,40 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocations; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionAllocationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"region\":\"enwash\",\"limit\":7707312982236790783,\"shareableQuota\":5267748012493523201,\"name\":{\"value\":\"wbpokulpiujwaasi\",\"localizedValue\":\"i\"}},\"id\":\"byuqerpqlp\",\"name\":\"wcciuqgbdbu\",\"type\":\"auvfbtkuwhhmhyk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.groupQuotaSubscriptionAllocations() - .list("ibahwflus", "dtmhrkwofyyvoqa", "piexpbtgiw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("enwash", response.iterator().next().properties().region()); - Assertions.assertEquals(7707312982236790783L, response.iterator().next().properties().limit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdInnerTests.java deleted file mode 100644 index f08d47ea53da5..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdInnerTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdProperties; - -public final class GroupQuotaSubscriptionIdInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionIdInner model = BinaryData.fromString( - "{\"properties\":{\"subscriptionId\":\"suuv\",\"provisioningState\":\"Created\"},\"id\":\"zkrwfn\",\"name\":\"iodjp\",\"type\":\"lwejdpv\"}") - .toObject(GroupQuotaSubscriptionIdInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionIdInner model - = new GroupQuotaSubscriptionIdInner().withProperties(new GroupQuotaSubscriptionIdProperties()); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionIdInner.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdListTests.java deleted file mode 100644 index 6de83b3c5742d..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdListTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdList; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdProperties; -import java.util.Arrays; - -public final class GroupQuotaSubscriptionIdListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionIdList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"subscriptionId\":\"hbcryffdfdosyge\",\"provisioningState\":\"Invalid\"},\"id\":\"jakhmsbzjh\",\"name\":\"rzevdphlxaol\",\"type\":\"hqtrgqjbpf\"}],\"nextLink\":\"s\"}") - .toObject(GroupQuotaSubscriptionIdList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionIdList model = new GroupQuotaSubscriptionIdList().withValue(Arrays - .asList(new GroupQuotaSubscriptionIdInner().withProperties(new GroupQuotaSubscriptionIdProperties()))); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionIdList.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdPropertiesTests.java deleted file mode 100644 index 5817ddda4c464..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionIdPropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdProperties; - -public final class GroupQuotaSubscriptionIdPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionIdProperties model - = BinaryData.fromString("{\"subscriptionId\":\"yoqpsoaccta\",\"provisioningState\":\"Accepted\"}") - .toObject(GroupQuotaSubscriptionIdProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionIdProperties model = new GroupQuotaSubscriptionIdProperties(); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionIdProperties.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusInnerTests.java deleted file mode 100644 index 08a49d5d3cee1..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusInnerTests.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaSubscriptionRequestStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionRequestStatusInner model = BinaryData.fromString( - "{\"properties\":{\"subscriptionId\":\"kzgcwrwcl\",\"requestSubmitTime\":\"2021-06-21T13:48:53Z\",\"provisioningState\":\"Canceled\"},\"id\":\"douskcqvkocrcjdk\",\"name\":\"tnhxbn\",\"type\":\"biksq\"}") - .toObject(GroupQuotaSubscriptionRequestStatusInner.class); - Assertions.assertEquals("kzgcwrwcl", model.properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T13:48:53Z"), model.properties().requestSubmitTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionRequestStatusInner model = new GroupQuotaSubscriptionRequestStatusInner() - .withProperties(new GroupQuotaSubscriptionRequestStatusProperties().withSubscriptionId("kzgcwrwcl") - .withRequestSubmitTime(OffsetDateTime.parse("2021-06-21T13:48:53Z"))); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionRequestStatusInner.class); - Assertions.assertEquals("kzgcwrwcl", model.properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-21T13:48:53Z"), model.properties().requestSubmitTime()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusListTests.java deleted file mode 100644 index bf4374452e07c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusListTests.java +++ /dev/null @@ -1,44 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusList; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusProperties; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaSubscriptionRequestStatusListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionRequestStatusList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"subscriptionId\":\"f\",\"requestSubmitTime\":\"2021-02-14T20:28:05Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"xxjtfe\",\"name\":\"luwfzitonpeqfpjk\",\"type\":\"lxofpdvhpfxxypin\"},{\"properties\":{\"subscriptionId\":\"ayhuy\",\"requestSubmitTime\":\"2021-05-05T04:33:07Z\",\"provisioningState\":\"Created\"},\"id\":\"epoo\",\"name\":\"inuvamiheogn\",\"type\":\"rxzxtheo\"},{\"properties\":{\"subscriptionId\":\"ivyevcciqihnhun\",\"requestSubmitTime\":\"2021-08-15T16:10:49Z\",\"provisioningState\":\"Created\"},\"id\":\"nfygxgispemvtz\",\"name\":\"kufubljo\",\"type\":\"xqeofjaeqjhqjba\"}],\"nextLink\":\"msmjqulngsntn\"}") - .toObject(GroupQuotaSubscriptionRequestStatusList.class); - Assertions.assertEquals("f", model.value().get(0).properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T20:28:05Z"), - model.value().get(0).properties().requestSubmitTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionRequestStatusList model - = new GroupQuotaSubscriptionRequestStatusList().withValue(Arrays.asList( - new GroupQuotaSubscriptionRequestStatusInner() - .withProperties(new GroupQuotaSubscriptionRequestStatusProperties().withSubscriptionId("f") - .withRequestSubmitTime(OffsetDateTime.parse("2021-02-14T20:28:05Z"))), - new GroupQuotaSubscriptionRequestStatusInner() - .withProperties(new GroupQuotaSubscriptionRequestStatusProperties().withSubscriptionId("ayhuy") - .withRequestSubmitTime(OffsetDateTime.parse("2021-05-05T04:33:07Z"))), - new GroupQuotaSubscriptionRequestStatusInner().withProperties( - new GroupQuotaSubscriptionRequestStatusProperties().withSubscriptionId("ivyevcciqihnhun") - .withRequestSubmitTime(OffsetDateTime.parse("2021-08-15T16:10:49Z"))))); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionRequestStatusList.class); - Assertions.assertEquals("f", model.value().get(0).properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-14T20:28:05Z"), - model.value().get(0).properties().requestSubmitTime()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusPropertiesTests.java deleted file mode 100644 index db2f8473db60c..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestStatusPropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaSubscriptionRequestStatusPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaSubscriptionRequestStatusProperties model = BinaryData.fromString( - "{\"subscriptionId\":\"lssai\",\"requestSubmitTime\":\"2021-09-05T10:45:28Z\",\"provisioningState\":\"Created\"}") - .toObject(GroupQuotaSubscriptionRequestStatusProperties.class); - Assertions.assertEquals("lssai", model.subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T10:45:28Z"), model.requestSubmitTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaSubscriptionRequestStatusProperties model - = new GroupQuotaSubscriptionRequestStatusProperties().withSubscriptionId("lssai") - .withRequestSubmitTime(OffsetDateTime.parse("2021-09-05T10:45:28Z")); - model = BinaryData.fromObject(model).toObject(GroupQuotaSubscriptionRequestStatusProperties.class); - Assertions.assertEquals("lssai", model.subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-05T10:45:28Z"), model.requestSubmitTime()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetWithResponseMockTests.java deleted file mode 100644 index db9b4f84f9610..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetWithResponseMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionRequestsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"subscriptionId\":\"bpybsrfbjf\",\"requestSubmitTime\":\"2021-07-05T13:20:17Z\",\"provisioningState\":\"Invalid\"},\"id\":\"t\",\"name\":\"tpvjzbexilzznfqq\",\"type\":\"vwpm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotaSubscriptionRequestStatus response = manager.groupQuotaSubscriptionRequests() - .getWithResponse("rruvwbhsq", "sub", "gjb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bpybsrfbjf", response.properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T13:20:17Z"), - response.properties().requestSubmitTime()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListMockTests.java deleted file mode 100644 index d7c23949b4f90..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatus; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionRequestsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"subscriptionId\":\"blmpewww\",\"requestSubmitTime\":\"2021-08-04T10:31:47Z\",\"provisioningState\":\"InProgress\"},\"id\":\"nsvs\",\"name\":\"q\",\"type\":\"ohxcrsbfova\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.groupQuotaSubscriptionRequests().list("lqbhsf", "obl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("blmpewww", response.iterator().next().properties().subscriptionId()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T10:31:47Z"), - response.iterator().next().properties().requestSubmitTime()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateMockTests.java deleted file mode 100644 index 905f0b1190fd8..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateMockTests.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.quota.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.quota.QuotaManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr = "{\"id\":\"gvpgy\",\"name\":\"gqgitxmedjvcsl\",\"type\":\"n\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProxyResource response = manager.groupQuotaSubscriptions() - .createOrUpdate("xknalaulppg", "dtpnapnyiropuhp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetWithResponseMockTests.java deleted file mode 100644 index 99a1ceff2b22e..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetWithResponseMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionId; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"subscriptionId\":\"izpost\",\"provisioningState\":\"Failed\"},\"id\":\"fbunrmfqjhhk\",\"name\":\"bpvjymjhx\",\"type\":\"j\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotaSubscriptionId response = manager.groupQuotaSubscriptions() - .getWithResponse("z", "ahzxctobgbk", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListMockTests.java deleted file mode 100644 index 0e391ca2478c1..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionId; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"subscriptionId\":\"krtswbxqz\",\"provisioningState\":\"Created\"},\"id\":\"fauvjfdxx\",\"name\":\"vetvt\",\"type\":\"qaqtdoqmcbxvwvxy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.groupQuotaSubscriptions().list("n", "u", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateMockTests.java deleted file mode 100644 index 930cae0f0489f..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateMockTests.java +++ /dev/null @@ -1,36 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionId; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaSubscriptionsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"subscriptionId\":\"oellwp\",\"provisioningState\":\"Succeeded\"},\"id\":\"gpfqbuace\",\"name\":\"pzfqrhhuaoppp\",\"type\":\"qeqxo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotaSubscriptionId response - = manager.groupQuotaSubscriptions().update("wwncwzzhxgk", "rmgucnap", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseNameTests.java deleted file mode 100644 index 23f268a9d40b1..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaUsagesBaseName; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaUsagesBaseNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaUsagesBaseName model = BinaryData.fromString("{\"value\":\"czvyifq\",\"localizedValue\":\"kdvjsll\"}") - .toObject(GroupQuotaUsagesBaseName.class); - Assertions.assertEquals("czvyifq", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaUsagesBaseName model = new GroupQuotaUsagesBaseName().withValue("czvyifq"); - model = BinaryData.fromObject(model).toObject(GroupQuotaUsagesBaseName.class); - Assertions.assertEquals("czvyifq", model.value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseTests.java deleted file mode 100644 index e0a51b47920e8..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesBaseTests.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotaUsagesBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotaUsagesBase model = BinaryData.fromString( - "{\"name\":{\"value\":\"s\",\"localizedValue\":\"ddystkiiuxhqy\"},\"limit\":8019571825859646594,\"usages\":1501001026308983782,\"unit\":\"b\"}") - .toObject(GroupQuotaUsagesBase.class); - Assertions.assertEquals(8019571825859646594L, model.limit()); - Assertions.assertEquals(1501001026308983782L, model.usages()); - Assertions.assertEquals("s", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotaUsagesBase model = new GroupQuotaUsagesBase().withLimit(8019571825859646594L) - .withUsages(1501001026308983782L) - .withValue("s"); - model = BinaryData.fromObject(model).toObject(GroupQuotaUsagesBase.class); - Assertions.assertEquals(8019571825859646594L, model.limit()); - Assertions.assertEquals(1501001026308983782L, model.usages()); - Assertions.assertEquals("s", model.value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListMockTests.java deleted file mode 100644 index 0774b2f9507b7..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.ResourceUsages; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotaUsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"name\":{\"value\":\"kl\",\"localizedValue\":\"xbjhwuaanozjosph\"},\"limit\":5037944209655699604,\"usages\":737566499822055742,\"unit\":\"xagl\"},\"id\":\"imjwosyt\",\"name\":\"itc\",\"type\":\"kfcktqum\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.groupQuotaUsages() - .list("fnjhfjxwmszkkfo", "rey", "kzikfjawneaivxwc", "elpcirelsfeaenwa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(5037944209655699604L, response.iterator().next().properties().limit()); - Assertions.assertEquals(737566499822055742L, response.iterator().next().properties().usages()); - Assertions.assertEquals("kl", response.iterator().next().properties().value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateMockTests.java deleted file mode 100644 index 49e030c56d11f..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateMockTests.java +++ /dev/null @@ -1,46 +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.quota.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.quota.QuotaManager; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotasCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr = "{\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProxyResource response = manager.groupQuotas() - .createOrUpdate("fbkp", "cg", - new GroupQuotasEntityInner().withProperties(new GroupQuotasEntityBase().withDisplayName("ndnhj") - .withAdditionalAttributes(new AdditionalAttributes().withGroupId( - new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("vylwzbtdhxuj")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))), - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBasePatchTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBasePatchTests.java deleted file mode 100644 index c209e1a2d5a27..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBasePatchTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBasePatch; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotasEntityBasePatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotasEntityBasePatch model = BinaryData.fromString( - "{\"displayName\":\"s\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"wnw\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Succeeded\"}") - .toObject(GroupQuotasEntityBasePatch.class); - Assertions.assertEquals("s", model.displayName()); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, - model.additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("wnw", model.additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, model.additionalAttributes().environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotasEntityBasePatch model = new GroupQuotasEntityBasePatch().withDisplayName("s") - .withAdditionalAttributes(new AdditionalAttributesPatch() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("wnw")) - .withEnvironment(EnvironmentType.NON_PRODUCTION)); - model = BinaryData.fromObject(model).toObject(GroupQuotasEntityBasePatch.class); - Assertions.assertEquals("s", model.displayName()); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, - model.additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("wnw", model.additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, model.additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBaseTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBaseTests.java deleted file mode 100644 index d5001dd74ab08..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityBaseTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotasEntityBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotasEntityBase model = BinaryData.fromString( - "{\"displayName\":\"tbmufpo\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"hwlrx\"},\"environment\":\"Production\"},\"provisioningState\":\"Succeeded\"}") - .toObject(GroupQuotasEntityBase.class); - Assertions.assertEquals("tbmufpo", model.displayName()); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, - model.additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("hwlrx", model.additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.PRODUCTION, model.additionalAttributes().environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotasEntityBase model = new GroupQuotasEntityBase().withDisplayName("tbmufpo") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("hwlrx")) - .withEnvironment(EnvironmentType.PRODUCTION)); - model = BinaryData.fromObject(model).toObject(GroupQuotasEntityBase.class); - Assertions.assertEquals("tbmufpo", model.displayName()); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, - model.additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("hwlrx", model.additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.PRODUCTION, model.additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityInnerTests.java deleted file mode 100644 index 3ac23a5c4cdc4..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityInnerTests.java +++ /dev/null @@ -1,45 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.AdditionalAttributes; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBase; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotasEntityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotasEntityInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"hq\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"pybczmehmtzopb\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"InProgress\"},\"id\":\"idgsybbe\",\"name\":\"hphoycm\",\"type\":\"xaobhdxbmtqioqjz\"}") - .toObject(GroupQuotasEntityInner.class); - Assertions.assertEquals("hq", model.properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("pybczmehmtzopb", model.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.properties().additionalAttributes().environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotasEntityInner model = new GroupQuotasEntityInner().withProperties(new GroupQuotasEntityBase() - .withDisplayName("hq") - .withAdditionalAttributes(new AdditionalAttributes() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID).withValue("pybczmehmtzopb")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))); - model = BinaryData.fromObject(model).toObject(GroupQuotasEntityInner.class); - Assertions.assertEquals("hq", model.properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("pybczmehmtzopb", model.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityPatchTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityPatchTests.java deleted file mode 100644 index c80fa1706d82b..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasEntityPatchTests.java +++ /dev/null @@ -1,45 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBasePatch; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class GroupQuotasEntityPatchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupQuotasEntityPatch model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"xrifkwmrvkts\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"ipa\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Succeeded\"},\"id\":\"qucmpo\",\"name\":\"fdkfogk\",\"type\":\"ygjofjdd\"}") - .toObject(GroupQuotasEntityPatch.class); - Assertions.assertEquals("xrifkwmrvkts", model.properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("ipa", model.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.properties().additionalAttributes().environment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupQuotasEntityPatch model = new GroupQuotasEntityPatch() - .withProperties(new GroupQuotasEntityBasePatch().withDisplayName("xrifkwmrvkts") - .withAdditionalAttributes(new AdditionalAttributesPatch() - .withGroupId(new GroupingId().withGroupingIdType(GroupingIdType.BILLING_ID).withValue("ipa")) - .withEnvironment(EnvironmentType.NON_PRODUCTION))); - model = BinaryData.fromObject(model).toObject(GroupQuotasEntityPatch.class); - Assertions.assertEquals("xrifkwmrvkts", model.properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - model.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("ipa", model.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - model.properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetWithResponseMockTests.java deleted file mode 100644 index 59b7fe8673d76..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"displayName\":\"umveekgpwozuhkf\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"ofd\"},\"environment\":\"Production\"},\"provisioningState\":\"Failed\"},\"id\":\"ttouwaboekqvkel\",\"name\":\"smv\",\"type\":\"xwyjsflhhc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotasEntity response = manager.groupQuotas() - .getWithResponse("nxipeil", "jzuaejxdultskzbb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("umveekgpwozuhkf", response.properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - response.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("ofd", response.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.PRODUCTION, response.properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasListMockTests.java deleted file mode 100644 index 82f6c4543990d..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasListMockTests.java +++ /dev/null @@ -1,46 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotasListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"isxyawjoyaqcslyj\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"BillingId\",\"value\":\"zyexzn\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Succeeded\"},\"id\":\"rzt\",\"name\":\"o\",\"type\":\"hb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.groupQuotas().list("aln", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("isxyawjoyaqcslyj", response.iterator().next().properties().displayName()); - Assertions.assertEquals(GroupingIdType.BILLING_ID, - response.iterator().next().properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("zyexzn", - response.iterator().next().properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - response.iterator().next().properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateMockTests.java deleted file mode 100644 index 59e58d9fe8a60..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateMockTests.java +++ /dev/null @@ -1,54 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.AdditionalAttributesPatch; -import com.azure.resourcemanager.quota.models.EnvironmentType; -import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityBasePatch; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class GroupQuotasUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"displayName\":\"cqibycnojv\",\"additionalAttributes\":{\"groupId\":{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"qsgzvahapj\"},\"environment\":\"NonProduction\"},\"provisioningState\":\"Succeeded\"},\"id\":\"qzcjrvxdj\",\"name\":\"lmwlxkvugfhzo\",\"type\":\"awjvzunluthnnp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GroupQuotasEntity response = manager.groupQuotas() - .update("wxzvlvqhjkb", "gibtnm", - new GroupQuotasEntityPatch().withProperties(new GroupQuotasEntityBasePatch().withDisplayName("bwwaloa") - .withAdditionalAttributes(new AdditionalAttributesPatch().withGroupId( - new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("tzjuzgwyzmhtxo")) - .withEnvironment(EnvironmentType.PRODUCTION))), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cqibycnojv", response.properties().displayName()); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, - response.properties().additionalAttributes().groupId().groupingIdType()); - Assertions.assertEquals("qsgzvahapj", response.properties().additionalAttributes().groupId().value()); - Assertions.assertEquals(EnvironmentType.NON_PRODUCTION, - response.properties().additionalAttributes().environment()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupingIdTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupingIdTests.java deleted file mode 100644 index 9f703341b1c97..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/GroupingIdTests.java +++ /dev/null @@ -1,28 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.GroupingId; -import com.azure.resourcemanager.quota.models.GroupingIdType; -import org.junit.jupiter.api.Assertions; - -public final class GroupingIdTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GroupingId model = BinaryData.fromString("{\"groupingIdType\":\"ServiceTreeId\",\"value\":\"c\"}") - .toObject(GroupingId.class); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, model.groupingIdType()); - Assertions.assertEquals("c", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GroupingId model = new GroupingId().withGroupingIdType(GroupingIdType.SERVICE_TREE_ID).withValue("c"); - model = BinaryData.fromObject(model).toObject(GroupingId.class); - Assertions.assertEquals(GroupingIdType.SERVICE_TREE_ID, model.groupingIdType()); - Assertions.assertEquals("c", model.value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitJsonObjectTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitJsonObjectTests.java deleted file mode 100644 index ccb672b721957..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitJsonObjectTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.LimitJsonObject; - -public final class LimitJsonObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LimitJsonObject model - = BinaryData.fromString("{\"limitObjectType\":\"LimitJsonObject\"}").toObject(LimitJsonObject.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LimitJsonObject model = new LimitJsonObject(); - model = BinaryData.fromObject(model).toObject(LimitJsonObject.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitObjectTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitObjectTests.java deleted file mode 100644 index fcd4b542b0ab5..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LimitObjectTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.LimitObject; -import com.azure.resourcemanager.quota.models.QuotaLimitTypes; -import org.junit.jupiter.api.Assertions; - -public final class LimitObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LimitObject model = BinaryData - .fromString("{\"limitObjectType\":\"LimitValue\",\"value\":1353933533,\"limitType\":\"Independent\"}") - .toObject(LimitObject.class); - Assertions.assertEquals(1353933533, model.value()); - Assertions.assertEquals(QuotaLimitTypes.INDEPENDENT, model.limitType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LimitObject model = new LimitObject().withValue(1353933533).withLimitType(QuotaLimitTypes.INDEPENDENT); - model = BinaryData.fromObject(model).toObject(LimitObject.class); - Assertions.assertEquals(1353933533, model.value()); - Assertions.assertEquals(QuotaLimitTypes.INDEPENDENT, model.limitType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponseInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponseInnerTests.java deleted file mode 100644 index 1e426e3c75b90..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponseInnerTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.LroResponseInner; -import com.azure.resourcemanager.quota.models.LroResponseProperties; - -public final class LroResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LroResponseInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\"},\"id\":\"nrbtcqqjnq\",\"name\":\"lhqgnufooojy\",\"type\":\"ifsqesaagdfmg\"}") - .toObject(LroResponseInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LroResponseInner model = new LroResponseInner().withProperties(new LroResponseProperties()); - model = BinaryData.fromObject(model).toObject(LroResponseInner.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponsePropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponsePropertiesTests.java deleted file mode 100644 index b87f8db9e668b..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/LroResponsePropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.LroResponseProperties; - -public final class LroResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LroResponseProperties model - = BinaryData.fromString("{\"provisioningState\":\"Created\"}").toObject(LroResponseProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LroResponseProperties model = new LroResponseProperties(); - model = BinaryData.fromObject(model).toObject(LroResponseProperties.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationDisplayTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationDisplayTests.java deleted file mode 100644 index 8b81e21cc1307..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationDisplayTests.java +++ /dev/null @@ -1,36 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"twm\",\"resource\":\"ytdxwit\",\"operation\":\"rjaw\",\"description\":\"wgxhn\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("twm", model.provider()); - Assertions.assertEquals("ytdxwit", model.resource()); - Assertions.assertEquals("rjaw", model.operation()); - Assertions.assertEquals("wgxhn", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("twm") - .withResource("ytdxwit") - .withOperation("rjaw") - .withDescription("wgxhn"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("twm", model.provider()); - Assertions.assertEquals("ytdxwit", model.resource()); - Assertions.assertEquals("rjaw", model.operation()); - Assertions.assertEquals("wgxhn", model.description()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationListTests.java deleted file mode 100644 index c5dad4b73a35b..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationListTests.java +++ /dev/null @@ -1,66 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.quota.models.OperationDisplay; -import com.azure.resourcemanager.quota.models.OperationList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = BinaryData.fromString( - "{\"value\":[{\"name\":\"vjtoqnermclfp\",\"display\":{\"provider\":\"oxuscrpabgyepsbj\",\"resource\":\"zq\",\"operation\":\"xywpmueefjzwfqkq\",\"description\":\"ids\"},\"origin\":\"onobglaocqx\"},{\"name\":\"cmgyud\",\"display\":{\"provider\":\"lmoyrx\",\"resource\":\"fudwpznt\",\"operation\":\"dzhlrq\",\"description\":\"hckfrlhrx\"},\"origin\":\"kyv\"},{\"name\":\"ca\",\"display\":{\"provider\":\"bpzkafkuwbc\",\"resource\":\"wbme\",\"operation\":\"seyvj\",\"description\":\"rts\"},\"origin\":\"spkdee\"},{\"name\":\"ofmxagkvtmelmqkr\",\"display\":{\"provider\":\"vljua\",\"resource\":\"quhcdhmduala\",\"operation\":\"qpv\",\"description\":\"dmwsrcrgvxpvgomz\"},\"origin\":\"misgwbnb\"}],\"nextLink\":\"ldawkzbaliourqha\"}") - .toObject(OperationList.class); - Assertions.assertEquals("vjtoqnermclfp", model.value().get(0).name()); - Assertions.assertEquals("oxuscrpabgyepsbj", model.value().get(0).display().provider()); - Assertions.assertEquals("zq", model.value().get(0).display().resource()); - Assertions.assertEquals("xywpmueefjzwfqkq", model.value().get(0).display().operation()); - Assertions.assertEquals("ids", model.value().get(0).display().description()); - Assertions.assertEquals("onobglaocqx", model.value().get(0).origin()); - Assertions.assertEquals("ldawkzbaliourqha", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = new OperationList().withValue(Arrays.asList( - new OperationResponseInner().withName("vjtoqnermclfp") - .withDisplay(new OperationDisplay().withProvider("oxuscrpabgyepsbj") - .withResource("zq") - .withOperation("xywpmueefjzwfqkq") - .withDescription("ids")) - .withOrigin("onobglaocqx"), - new OperationResponseInner().withName("cmgyud") - .withDisplay(new OperationDisplay().withProvider("lmoyrx") - .withResource("fudwpznt") - .withOperation("dzhlrq") - .withDescription("hckfrlhrx")) - .withOrigin("kyv"), - new OperationResponseInner().withName("ca") - .withDisplay(new OperationDisplay().withProvider("bpzkafkuwbc") - .withResource("wbme") - .withOperation("seyvj") - .withDescription("rts")) - .withOrigin("spkdee"), - new OperationResponseInner().withName("ofmxagkvtmelmqkr") - .withDisplay(new OperationDisplay().withProvider("vljua") - .withResource("quhcdhmduala") - .withOperation("qpv") - .withDescription("dmwsrcrgvxpvgomz")) - .withOrigin("misgwbnb"))) - .withNextLink("ldawkzbaliourqha"); - model = BinaryData.fromObject(model).toObject(OperationList.class); - Assertions.assertEquals("vjtoqnermclfp", model.value().get(0).name()); - Assertions.assertEquals("oxuscrpabgyepsbj", model.value().get(0).display().provider()); - Assertions.assertEquals("zq", model.value().get(0).display().resource()); - Assertions.assertEquals("xywpmueefjzwfqkq", model.value().get(0).display().operation()); - Assertions.assertEquals("ids", model.value().get(0).display().description()); - Assertions.assertEquals("onobglaocqx", model.value().get(0).origin()); - Assertions.assertEquals("ldawkzbaliourqha", model.nextLink()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationResponseInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationResponseInnerTests.java deleted file mode 100644 index 64528c2233249..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/OperationResponseInnerTests.java +++ /dev/null @@ -1,42 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.quota.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResponseInner model = BinaryData.fromString( - "{\"name\":\"uhashsfwx\",\"display\":{\"provider\":\"w\",\"resource\":\"cugicjoox\",\"operation\":\"ebwpucwwfvo\",\"description\":\"vmeueci\"},\"origin\":\"hzceuojgjrwjue\"}") - .toObject(OperationResponseInner.class); - Assertions.assertEquals("uhashsfwx", model.name()); - Assertions.assertEquals("w", model.display().provider()); - Assertions.assertEquals("cugicjoox", model.display().resource()); - Assertions.assertEquals("ebwpucwwfvo", model.display().operation()); - Assertions.assertEquals("vmeueci", model.display().description()); - Assertions.assertEquals("hzceuojgjrwjue", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResponseInner model = new OperationResponseInner().withName("uhashsfwx") - .withDisplay(new OperationDisplay().withProvider("w") - .withResource("cugicjoox") - .withOperation("ebwpucwwfvo") - .withDescription("vmeueci")) - .withOrigin("hzceuojgjrwjue"); - model = BinaryData.fromObject(model).toObject(OperationResponseInner.class); - Assertions.assertEquals("uhashsfwx", model.name()); - Assertions.assertEquals("w", model.display().provider()); - Assertions.assertEquals("cugicjoox", model.display().resource()); - Assertions.assertEquals("ebwpucwwfvo", model.display().operation()); - Assertions.assertEquals("vmeueci", model.display().description()); - Assertions.assertEquals("hzceuojgjrwjue", model.origin()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesNameTests.java deleted file mode 100644 index 8bec98565a8de..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestBasePropertiesName; - -public final class QuotaAllocationRequestBasePropertiesNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaAllocationRequestBasePropertiesName model - = BinaryData.fromString("{\"value\":\"yggdtjixh\",\"localizedValue\":\"uofqwe\"}") - .toObject(QuotaAllocationRequestBasePropertiesName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaAllocationRequestBasePropertiesName model = new QuotaAllocationRequestBasePropertiesName(); - model = BinaryData.fromObject(model).toObject(QuotaAllocationRequestBasePropertiesName.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesTests.java deleted file mode 100644 index 9a2691f12844a..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBasePropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestBaseProperties; -import org.junit.jupiter.api.Assertions; - -public final class QuotaAllocationRequestBasePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaAllocationRequestBaseProperties model = BinaryData.fromString( - "{\"limit\":1364175055394963114,\"name\":{\"value\":\"orxzdmohctbqvud\",\"localizedValue\":\"dndnvow\"},\"region\":\"jjugwdkcglhslaz\"}") - .toObject(QuotaAllocationRequestBaseProperties.class); - Assertions.assertEquals(1364175055394963114L, model.limit()); - Assertions.assertEquals("jjugwdkcglhslaz", model.region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaAllocationRequestBaseProperties model - = new QuotaAllocationRequestBaseProperties().withLimit(1364175055394963114L).withRegion("jjugwdkcglhslaz"); - model = BinaryData.fromObject(model).toObject(QuotaAllocationRequestBaseProperties.class); - Assertions.assertEquals(1364175055394963114L, model.limit()); - Assertions.assertEquals("jjugwdkcglhslaz", model.region()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBaseTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBaseTests.java deleted file mode 100644 index 1e98965fed011..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaAllocationRequestBaseTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; -import org.junit.jupiter.api.Assertions; - -public final class QuotaAllocationRequestBaseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaAllocationRequestBase model = BinaryData.fromString( - "{\"properties\":{\"limit\":6981573049423863635,\"name\":{\"value\":\"h\",\"localizedValue\":\"ltyfsop\"},\"region\":\"suesnzw\"}}") - .toObject(QuotaAllocationRequestBase.class); - Assertions.assertEquals(6981573049423863635L, model.limit()); - Assertions.assertEquals("suesnzw", model.region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaAllocationRequestBase model - = new QuotaAllocationRequestBase().withLimit(6981573049423863635L).withRegion("suesnzw"); - model = BinaryData.fromObject(model).toObject(QuotaAllocationRequestBase.class); - Assertions.assertEquals(6981573049423863635L, model.limit()); - Assertions.assertEquals("suesnzw", model.region()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaLimitsTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaLimitsTests.java deleted file mode 100644 index a88e2f08ffd94..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaLimitsTests.java +++ /dev/null @@ -1,52 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.models.LimitJsonObject; -import com.azure.resourcemanager.quota.models.QuotaLimits; -import com.azure.resourcemanager.quota.models.QuotaProperties; -import com.azure.resourcemanager.quota.models.ResourceName; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaLimits model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"c\",\"name\":{\"value\":\"hfnljkyq\",\"localizedValue\":\"vuujq\"},\"resourceType\":\"dokgjl\",\"quotaPeriod\":\"oxgvclt\",\"isQuotaApplicable\":true,\"properties\":\"datac\"},\"id\":\"hkjeszzhbi\",\"name\":\"htxfvgxbfsmxnehm\",\"type\":\"vecxgodebfqkk\"},{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"ukgri\",\"name\":{\"value\":\"zlfbxzpuzycispnq\",\"localizedValue\":\"hmgkbrpyy\"},\"resourceType\":\"ibnuqqkpik\",\"quotaPeriod\":\"rgvtqag\",\"isQuotaApplicable\":false,\"properties\":\"datanhijggmebfsi\"},\"id\":\"rbu\",\"name\":\"rcvpnazzmhjrunmp\",\"type\":\"ttdbhrbnl\"},{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"myskpbhenbtkcxy\",\"name\":{\"value\":\"tnrsyn\",\"localizedValue\":\"idybyxczf\"},\"resourceType\":\"haaxdbabphl\",\"quotaPeriod\":\"qlfktsths\",\"isQuotaApplicable\":true,\"properties\":\"datamnyyazt\"},\"id\":\"bt\",\"name\":\"wrqpue\",\"type\":\"ckzywbiexzfeyue\"},{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"xujwbhqwalmuzyo\",\"name\":{\"value\":\"pdkzjancuxr\",\"localizedValue\":\"wbavxbniwdj\"},\"resourceType\":\"zt\",\"quotaPeriod\":\"bpg\",\"isQuotaApplicable\":false,\"properties\":\"datax\"},\"id\":\"pzxbz\",\"name\":\"fzab\",\"type\":\"lcuhxwtctyqiklb\"}],\"nextLink\":\"vplwzbhv\"}") - .toObject(QuotaLimits.class); - Assertions.assertEquals("hfnljkyq", model.value().get(0).properties().name().value()); - Assertions.assertEquals("dokgjl", model.value().get(0).properties().resourceType()); - Assertions.assertEquals("vplwzbhv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaLimits model = new QuotaLimits().withValue(Arrays.asList( - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("hfnljkyq")) - .withResourceType("dokgjl") - .withProperties("datac")), - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("zlfbxzpuzycispnq")) - .withResourceType("ibnuqqkpik") - .withProperties("datanhijggmebfsi")), - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("tnrsyn")) - .withResourceType("haaxdbabphl") - .withProperties("datamnyyazt")), - new CurrentQuotaLimitBaseInner().withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("pdkzjancuxr")) - .withResourceType("zt") - .withProperties("datax")))) - .withNextLink("vplwzbhv"); - model = BinaryData.fromObject(model).toObject(QuotaLimits.class); - Assertions.assertEquals("hfnljkyq", model.value().get(0).properties().name().value()); - Assertions.assertEquals("dokgjl", model.value().get(0).properties().resourceType()); - Assertions.assertEquals("vplwzbhv", model.nextLink()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaOperationsListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaOperationsListMockTests.java deleted file mode 100644 index 2b7f800780c13..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaOperationsListMockTests.java +++ /dev/null @@ -1,43 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.OperationResponse; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QuotaOperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"ehtwdwrft\",\"display\":{\"provider\":\"byrcdlbhshfwp\",\"resource\":\"cstwity\",\"operation\":\"evxccedcp\",\"description\":\"dyodnwzxltj\"},\"origin\":\"nhltiugcxn\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.quotaOperations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ehtwdwrft", response.iterator().next().name()); - Assertions.assertEquals("byrcdlbhshfwp", response.iterator().next().display().provider()); - Assertions.assertEquals("cstwity", response.iterator().next().display().resource()); - Assertions.assertEquals("evxccedcp", response.iterator().next().display().operation()); - Assertions.assertEquals("dyodnwzxltj", response.iterator().next().display().description()); - Assertions.assertEquals("nhltiugcxn", response.iterator().next().origin()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaPropertiesTests.java deleted file mode 100644 index e0a71006d6947..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaPropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.LimitJsonObject; -import com.azure.resourcemanager.quota.models.QuotaProperties; -import com.azure.resourcemanager.quota.models.ResourceName; -import org.junit.jupiter.api.Assertions; - -public final class QuotaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaProperties model = BinaryData.fromString( - "{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"zpwv\",\"name\":{\"value\":\"q\",\"localizedValue\":\"iqylihkaetck\"},\"resourceType\":\"fcivfsnkym\",\"quotaPeriod\":\"tqhjfbebrjcx\",\"isQuotaApplicable\":true,\"properties\":\"datawutttxfvjrbi\"}") - .toObject(QuotaProperties.class); - Assertions.assertEquals("q", model.name().value()); - Assertions.assertEquals("fcivfsnkym", model.resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaProperties model = new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("q")) - .withResourceType("fcivfsnkym") - .withProperties("datawutttxfvjrbi"); - model = BinaryData.fromObject(model).toObject(QuotaProperties.class); - Assertions.assertEquals("q", model.name().value()); - Assertions.assertEquals("fcivfsnkym", model.resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasCreateOrUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasCreateOrUpdateMockTests.java deleted file mode 100644 index 0acfccc0a7ffe..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasCreateOrUpdateMockTests.java +++ /dev/null @@ -1,48 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.quota.models.LimitJsonObject; -import com.azure.resourcemanager.quota.models.QuotaProperties; -import com.azure.resourcemanager.quota.models.ResourceName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QuotasCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"dsnfdsdoakgtdl\",\"name\":{\"value\":\"zev\",\"localizedValue\":\"hewpusdsttwv\"},\"resourceType\":\"vbbejdcng\",\"quotaPeriod\":\"m\",\"isQuotaApplicable\":false,\"properties\":\"datafgmjzrwrdgrt\"},\"id\":\"aenuuz\",\"name\":\"opbminrfdw\",\"type\":\"yuhhziu\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CurrentQuotaLimitBase response = manager.quotas() - .define("pzfoqoui") - .withExistingScope("ybxarzgszu") - .withProperties(new QuotaProperties().withLimit(new LimitJsonObject()) - .withName(new ResourceName().withValue("azxkhnzbonlwnto")) - .withResourceType("kszzcmrvexztv") - .withProperties("dataguxawqaldsyuuxi")) - .create(); - - Assertions.assertEquals("zev", response.properties().name().value()); - Assertions.assertEquals("vbbejdcng", response.properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasGetWithResponseMockTests.java deleted file mode 100644 index cdf1fd8b4e88b..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasGetWithResponseMockTests.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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QuotasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"ztppriolxorjalto\",\"name\":{\"value\":\"cwsobqwcs\",\"localizedValue\":\"nwdcfhu\"},\"resourceType\":\"dpfuvg\",\"quotaPeriod\":\"bjj\",\"isQuotaApplicable\":false,\"properties\":\"dataxbvtvudu\"},\"id\":\"ncormrlxqtvcof\",\"name\":\"dflvkg\",\"type\":\"u\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CurrentQuotaLimitBase response - = manager.quotas().getWithResponse("fz", "whxxbuyqax", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("cwsobqwcs", response.properties().name().value()); - Assertions.assertEquals("dpfuvg", response.properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasListMockTests.java deleted file mode 100644 index b13c050607604..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotasListMockTests.java +++ /dev/null @@ -1,40 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class QuotasListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"limit\":{\"limitObjectType\":\"LimitJsonObject\"},\"unit\":\"qntorudsgsahmkyc\",\"name\":{\"value\":\"uwjuetaeburuvdmo\",\"localizedValue\":\"mz\"},\"resourceType\":\"wabm\",\"quotaPeriod\":\"efkifr\",\"isQuotaApplicable\":true,\"properties\":\"dataqujmqlgkf\"},\"id\":\"tndoaongbjc\",\"name\":\"tujitcjedft\",\"type\":\"waezkojvd\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.quotas().list("gdknnqv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("uwjuetaeburuvdmo", response.iterator().next().properties().name().value()); - Assertions.assertEquals("wabm", response.iterator().next().properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceNameTests.java deleted file mode 100644 index bee5ae6284810..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.ResourceName; -import org.junit.jupiter.api.Assertions; - -public final class ResourceNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceName model = BinaryData.fromString("{\"value\":\"ngkpocipazy\",\"localizedValue\":\"egukgjnpiucg\"}") - .toObject(ResourceName.class); - Assertions.assertEquals("ngkpocipazy", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceName model = new ResourceName().withValue("ngkpocipazy"); - model = BinaryData.fromObject(model).toObject(ResourceName.class); - Assertions.assertEquals("ngkpocipazy", model.value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsageListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsageListTests.java deleted file mode 100644 index cf36eed3b0824..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsageListTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import com.azure.resourcemanager.quota.models.ResourceUsageList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ResourceUsageListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceUsageList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"name\":{\"value\":\"amdecte\",\"localizedValue\":\"iqscjeypv\"},\"limit\":5856868160780933935,\"usages\":2742951421766727417,\"unit\":\"c\"},\"id\":\"efovgmk\",\"name\":\"sle\",\"type\":\"yvxyqjp\"},{\"properties\":{\"name\":{\"value\":\"tpngjcrcczsqpjh\",\"localizedValue\":\"daj\"},\"limit\":4392638781282274584,\"usages\":1463154876474108196,\"unit\":\"e\"},\"id\":\"noae\",\"name\":\"pfhyhl\",\"type\":\"rpmopjmc\"}],\"nextLink\":\"tuo\"}") - .toObject(ResourceUsageList.class); - Assertions.assertEquals(5856868160780933935L, model.value().get(0).properties().limit()); - Assertions.assertEquals(2742951421766727417L, model.value().get(0).properties().usages()); - Assertions.assertEquals("amdecte", model.value().get(0).properties().value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceUsageList model = new ResourceUsageList().withValue(Arrays.asList( - new ResourceUsagesInner().withProperties(new GroupQuotaUsagesBase().withLimit(5856868160780933935L) - .withUsages(2742951421766727417L) - .withValue("amdecte")), - new ResourceUsagesInner().withProperties(new GroupQuotaUsagesBase().withLimit(4392638781282274584L) - .withUsages(1463154876474108196L) - .withValue("tpngjcrcczsqpjh")))); - model = BinaryData.fromObject(model).toObject(ResourceUsageList.class); - Assertions.assertEquals(5856868160780933935L, model.value().get(0).properties().limit()); - Assertions.assertEquals(2742951421766727417L, model.value().get(0).properties().usages()); - Assertions.assertEquals("amdecte", model.value().get(0).properties().value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsagesInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsagesInnerTests.java deleted file mode 100644 index 4eac9eb41d7ff..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ResourceUsagesInnerTests.java +++ /dev/null @@ -1,34 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import org.junit.jupiter.api.Assertions; - -public final class ResourceUsagesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceUsagesInner model = BinaryData.fromString( - "{\"properties\":{\"name\":{\"value\":\"uiuaodsfcpkvxodp\",\"localizedValue\":\"zmyzydagf\"},\"limit\":4781017836578252450,\"usages\":7954521876699219554,\"unit\":\"uokktwhrdxwz\"},\"id\":\"q\",\"name\":\"mbsureximo\",\"type\":\"yocf\"}") - .toObject(ResourceUsagesInner.class); - Assertions.assertEquals(4781017836578252450L, model.properties().limit()); - Assertions.assertEquals(7954521876699219554L, model.properties().usages()); - Assertions.assertEquals("uiuaodsfcpkvxodp", model.properties().value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceUsagesInner model - = new ResourceUsagesInner().withProperties(new GroupQuotaUsagesBase().withLimit(4781017836578252450L) - .withUsages(7954521876699219554L) - .withValue("uiuaodsfcpkvxodp")); - model = BinaryData.fromObject(model).toObject(ResourceUsagesInner.class); - Assertions.assertEquals(4781017836578252450L, model.properties().limit()); - Assertions.assertEquals(7954521876699219554L, model.properties().usages()); - Assertions.assertEquals("uiuaodsfcpkvxodp", model.properties().value()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubRequestTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubRequestTests.java deleted file mode 100644 index f475207b794df..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubRequestTests.java +++ /dev/null @@ -1,32 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.LimitJsonObject; -import com.azure.resourcemanager.quota.models.ResourceName; -import com.azure.resourcemanager.quota.models.SubRequest; -import org.junit.jupiter.api.Assertions; - -public final class SubRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubRequest model = BinaryData.fromString( - "{\"name\":{\"value\":\"nyqupedeojnabck\",\"localizedValue\":\"mtxpsiebtfh\"},\"resourceType\":\"esap\",\"unit\":\"rdqmhjjdhtldwkyz\",\"provisioningState\":\"InProgress\",\"message\":\"kn\",\"subRequestId\":\"scwsv\",\"limit\":{\"limitObjectType\":\"LimitJsonObject\"}}") - .toObject(SubRequest.class); - Assertions.assertEquals("nyqupedeojnabck", model.name().value()); - Assertions.assertEquals("rdqmhjjdhtldwkyz", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubRequest model = new SubRequest().withName(new ResourceName().withValue("nyqupedeojnabck")) - .withUnit("rdqmhjjdhtldwkyz") - .withLimit(new LimitJsonObject()); - model = BinaryData.fromObject(model).toObject(SubRequest.class); - Assertions.assertEquals("nyqupedeojnabck", model.name().value()); - Assertions.assertEquals("rdqmhjjdhtldwkyz", model.unit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsInnerTests.java deleted file mode 100644 index 6230bfe7bc108..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsInnerTests.java +++ /dev/null @@ -1,30 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaDetails; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionQuotaAllocationsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionQuotaAllocationsInner model = BinaryData.fromString( - "{\"properties\":{\"region\":\"m\",\"limit\":1354331063436305404,\"shareableQuota\":3154425840860812324,\"name\":{\"value\":\"evgbmqjq\",\"localizedValue\":\"c\"}},\"id\":\"mivkwlzuvcc\",\"name\":\"wnfnbacf\",\"type\":\"onlebxetqgtzxdpn\"}") - .toObject(SubscriptionQuotaAllocationsInner.class); - Assertions.assertEquals("m", model.properties().region()); - Assertions.assertEquals(1354331063436305404L, model.properties().limit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionQuotaAllocationsInner model = new SubscriptionQuotaAllocationsInner() - .withProperties(new SubscriptionQuotaDetails().withRegion("m").withLimit(1354331063436305404L)); - model = BinaryData.fromObject(model).toObject(SubscriptionQuotaAllocationsInner.class); - Assertions.assertEquals("m", model.properties().region()); - Assertions.assertEquals(1354331063436305404L, model.properties().limit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsListTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsListTests.java deleted file mode 100644 index 6ba825e2d2f1a..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaAllocationsListTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsInner; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaDetails; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionQuotaAllocationsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionQuotaAllocationsList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"region\":\"xxppofm\",\"limit\":685251930368374403,\"shareableQuota\":3544936977106916903,\"name\":{\"value\":\"dtocj\",\"localizedValue\":\"hvpmoue\"}},\"id\":\"dzxibqeojnxqbzvd\",\"name\":\"ntwndeicbtwnpzao\",\"type\":\"vuhrhcffcyddgl\"},{\"properties\":{\"region\":\"hjq\",\"limit\":6943639735240918018,\"shareableQuota\":3955309032354146781,\"name\":{\"value\":\"qciwqvhkhixuigdt\",\"localizedValue\":\"bob\"}},\"id\":\"ghmewuam\",\"name\":\"uhrzayvvt\",\"type\":\"gvdfgiotkftutq\"},{\"properties\":{\"region\":\"gxlefgugnxkrxd\",\"limit\":979128831673863857,\"shareableQuota\":2903451662374924947,\"name\":{\"value\":\"vqdra\",\"localizedValue\":\"jybige\"}},\"id\":\"qfbow\",\"name\":\"kanyktzlcuiywg\",\"type\":\"ywgndrv\"}],\"nextLink\":\"hzgpphrcgyncocpe\"}") - .toObject(SubscriptionQuotaAllocationsList.class); - Assertions.assertEquals("xxppofm", model.value().get(0).properties().region()); - Assertions.assertEquals(685251930368374403L, model.value().get(0).properties().limit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionQuotaAllocationsList model = new SubscriptionQuotaAllocationsList().withValue(Arrays.asList( - new SubscriptionQuotaAllocationsInner() - .withProperties(new SubscriptionQuotaDetails().withRegion("xxppofm").withLimit(685251930368374403L)), - new SubscriptionQuotaAllocationsInner() - .withProperties(new SubscriptionQuotaDetails().withRegion("hjq").withLimit(6943639735240918018L)), - new SubscriptionQuotaAllocationsInner().withProperties( - new SubscriptionQuotaDetails().withRegion("gxlefgugnxkrxd").withLimit(979128831673863857L)))); - model = BinaryData.fromObject(model).toObject(SubscriptionQuotaAllocationsList.class); - Assertions.assertEquals("xxppofm", model.value().get(0).properties().region()); - Assertions.assertEquals(685251930368374403L, model.value().get(0).properties().limit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsNameTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsNameTests.java deleted file mode 100644 index 84c731155dbcc..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsNameTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaDetailsName; - -public final class SubscriptionQuotaDetailsNameTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionQuotaDetailsName model = BinaryData.fromString("{\"value\":\"nzscxa\",\"localizedValue\":\"ooch\"}") - .toObject(SubscriptionQuotaDetailsName.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionQuotaDetailsName model = new SubscriptionQuotaDetailsName(); - model = BinaryData.fromObject(model).toObject(SubscriptionQuotaDetailsName.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsTests.java deleted file mode 100644 index 4ab4f1da97f21..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/SubscriptionQuotaDetailsTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaDetails; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionQuotaDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionQuotaDetails model = BinaryData.fromString( - "{\"region\":\"qqwx\",\"limit\":83601086548866102,\"shareableQuota\":8559873821751147559,\"name\":{\"value\":\"sub\",\"localizedValue\":\"njampm\"}}") - .toObject(SubscriptionQuotaDetails.class); - Assertions.assertEquals("qqwx", model.region()); - Assertions.assertEquals(83601086548866102L, model.limit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionQuotaDetails model - = new SubscriptionQuotaDetails().withRegion("qqwx").withLimit(83601086548866102L); - model = BinaryData.fromObject(model).toObject(SubscriptionQuotaDetails.class); - Assertions.assertEquals("qqwx", model.region()); - Assertions.assertEquals(83601086548866102L, model.limit()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesGetWithResponseMockTests.java deleted file mode 100644 index 3fac75a94bb40..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.CurrentUsagesBase; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"usages\":{\"value\":1682572993,\"usagesType\":\"Individual\"},\"unit\":\"xleptramx\",\"name\":{\"value\":\"wlwnwxuqlcv\",\"localizedValue\":\"ypatdooaojkniod\"},\"resourceType\":\"oebwnujhemms\",\"quotaPeriod\":\"dkcrodt\",\"isQuotaApplicable\":true,\"properties\":\"datawj\"},\"id\":\"fltkacjv\",\"name\":\"f\",\"type\":\"dlfoakggkfp\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CurrentUsagesBase response = manager.usages() - .getWithResponse("xiilivpdtiirqt", "qoaxoruzfgs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(1682572993, response.properties().usages().value()); - Assertions.assertEquals(UsagesTypes.INDIVIDUAL, response.properties().usages().usagesType()); - Assertions.assertEquals("wlwnwxuqlcv", response.properties().name().value()); - Assertions.assertEquals("oebwnujhemms", response.properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesLimitsTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesLimitsTests.java deleted file mode 100644 index 3f122e9fd30b2..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesLimitsTests.java +++ /dev/null @@ -1,46 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.models.ResourceName; -import com.azure.resourcemanager.quota.models.UsagesLimits; -import com.azure.resourcemanager.quota.models.UsagesObject; -import com.azure.resourcemanager.quota.models.UsagesProperties; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UsagesLimitsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsagesLimits model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"usages\":{\"value\":1616487247,\"usagesType\":\"Combined\"},\"unit\":\"pyd\",\"name\":{\"value\":\"hxdeoejz\",\"localizedValue\":\"w\"},\"resourceType\":\"sjttgzfbish\",\"quotaPeriod\":\"khaj\",\"isQuotaApplicable\":true,\"properties\":\"dataa\"},\"id\":\"dphagalpbuxwgip\",\"name\":\"honowkgshwank\",\"type\":\"xzbinjeputt\"}],\"nextLink\":\"ywnuzoq\"}") - .toObject(UsagesLimits.class); - Assertions.assertEquals(1616487247, model.value().get(0).properties().usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.value().get(0).properties().usages().usagesType()); - Assertions.assertEquals("hxdeoejz", model.value().get(0).properties().name().value()); - Assertions.assertEquals("sjttgzfbish", model.value().get(0).properties().resourceType()); - Assertions.assertEquals("ywnuzoq", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsagesLimits model = new UsagesLimits() - .withValue(Arrays.asList(new CurrentUsagesBaseInner().withProperties(new UsagesProperties() - .withUsages(new UsagesObject().withValue(1616487247).withUsagesType(UsagesTypes.COMBINED)) - .withName(new ResourceName().withValue("hxdeoejz")) - .withResourceType("sjttgzfbish") - .withProperties("dataa")))) - .withNextLink("ywnuzoq"); - model = BinaryData.fromObject(model).toObject(UsagesLimits.class); - Assertions.assertEquals(1616487247, model.value().get(0).properties().usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.value().get(0).properties().usages().usagesType()); - Assertions.assertEquals("hxdeoejz", model.value().get(0).properties().name().value()); - Assertions.assertEquals("sjttgzfbish", model.value().get(0).properties().resourceType()); - Assertions.assertEquals("ywnuzoq", model.nextLink()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesListMockTests.java deleted file mode 100644 index 55fb4f3dd8c24..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesListMockTests.java +++ /dev/null @@ -1,43 +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.quota.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.quota.QuotaManager; -import com.azure.resourcemanager.quota.models.CurrentUsagesBase; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class UsagesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"usages\":{\"value\":648285682,\"usagesType\":\"Individual\"},\"unit\":\"r\",\"name\":{\"value\":\"agxsdszuemps\",\"localizedValue\":\"kfzbeyvpnqicvi\"},\"resourceType\":\"kjj\",\"quotaPeriod\":\"xrbuukzclew\",\"isQuotaApplicable\":false,\"properties\":\"datawp\"},\"id\":\"ztzp\",\"name\":\"fn\",\"type\":\"ckw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - QuotaManager manager = QuotaManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.usages().list("gaowpulpqblylsyx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(648285682, response.iterator().next().properties().usages().value()); - Assertions.assertEquals(UsagesTypes.INDIVIDUAL, response.iterator().next().properties().usages().usagesType()); - Assertions.assertEquals("agxsdszuemps", response.iterator().next().properties().name().value()); - Assertions.assertEquals("kjj", response.iterator().next().properties().resourceType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesObjectTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesObjectTests.java deleted file mode 100644 index eecee48f1a7b3..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesObjectTests.java +++ /dev/null @@ -1,28 +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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.UsagesObject; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import org.junit.jupiter.api.Assertions; - -public final class UsagesObjectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsagesObject model - = BinaryData.fromString("{\"value\":1340454664,\"usagesType\":\"Combined\"}").toObject(UsagesObject.class); - Assertions.assertEquals(1340454664, model.value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.usagesType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsagesObject model = new UsagesObject().withValue(1340454664).withUsagesType(UsagesTypes.COMBINED); - model = BinaryData.fromObject(model).toObject(UsagesObject.class); - Assertions.assertEquals(1340454664, model.value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.usagesType()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesPropertiesTests.java deleted file mode 100644 index 214f5b11679c6..0000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/UsagesPropertiesTests.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.quota.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.quota.models.ResourceName; -import com.azure.resourcemanager.quota.models.UsagesObject; -import com.azure.resourcemanager.quota.models.UsagesProperties; -import com.azure.resourcemanager.quota.models.UsagesTypes; -import org.junit.jupiter.api.Assertions; - -public final class UsagesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UsagesProperties model = BinaryData.fromString( - "{\"usages\":{\"value\":1146785059,\"usagesType\":\"Combined\"},\"unit\":\"axkffei\",\"name\":{\"value\":\"lvmezyvshxmzsbbz\",\"localizedValue\":\"gigr\"},\"resourceType\":\"burvjxxjnspy\",\"quotaPeriod\":\"tko\",\"isQuotaApplicable\":true,\"properties\":\"datauknvudwti\"}") - .toObject(UsagesProperties.class); - Assertions.assertEquals(1146785059, model.usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.usages().usagesType()); - Assertions.assertEquals("lvmezyvshxmzsbbz", model.name().value()); - Assertions.assertEquals("burvjxxjnspy", model.resourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsagesProperties model = new UsagesProperties() - .withUsages(new UsagesObject().withValue(1146785059).withUsagesType(UsagesTypes.COMBINED)) - .withName(new ResourceName().withValue("lvmezyvshxmzsbbz")) - .withResourceType("burvjxxjnspy") - .withProperties("datauknvudwti"); - model = BinaryData.fromObject(model).toObject(UsagesProperties.class); - Assertions.assertEquals(1146785059, model.usages().value()); - Assertions.assertEquals(UsagesTypes.COMBINED, model.usages().usagesType()); - Assertions.assertEquals("lvmezyvshxmzsbbz", model.name().value()); - Assertions.assertEquals("burvjxxjnspy", model.resourceType()); - } -}