diff --git a/eng/automation/generate_utils.py b/eng/automation/generate_utils.py index bcbdf883df07..4ad4e48978d8 100755 --- a/eng/automation/generate_utils.py +++ b/eng/automation/generate_utils.py @@ -23,6 +23,16 @@ TSPCONFIG_URL_PATTERN = re.compile( r"^https://github.com/(?PAzure/azure-rest-api-specs(-pr)?)/blob/(?P[0-9a-f]{40})/(?P.*)/tspconfig.yaml$", ) + +GENERATED_SOURCE_CLEANUP_EXCLUDED_MODULES = { + "azure-resourcemanager-resources", +} + + +def should_remove_generated_source_code(module: str) -> bool: + return module not in GENERATED_SOURCE_CLEANUP_EXCLUDED_MODULES + + def remove_generated_source_code(sdk_folder: str, namespace: str): main_source_folder = os.path.join(sdk_folder, "src/main/java") main_resources_folder = os.path.join(sdk_folder, "src/main/resources") @@ -427,7 +437,12 @@ def generate_typespec_project( ) if remove_before_regen and group_id: - remove_generated_source_code(os.path.join(sdk_root, sdk_folder), f"{group_id}.{service}") + if should_remove_generated_source_code(module): + remove_generated_source_code(os.path.join(sdk_root, sdk_folder), f"{group_id}.{service}") + else: + logging.info( + f"[GENERATE] Skipping generated source cleanup for module {module}." + ) if api_version: emitter_options.append(f"api-version={api_version}") diff --git a/eng/automation/test_generate.py b/eng/automation/test_generate.py index a34ea476e4a0..b73aaad3c2c8 100644 --- a/eng/automation/test_generate.py +++ b/eng/automation/test_generate.py @@ -3,6 +3,7 @@ import unittest from generate import update_revapi_skip +from generate_utils import should_remove_generated_source_code from utils import is_first_release POM_WITH_REVAPI_TRUE = """\ @@ -134,5 +135,14 @@ def test_missing_file_returns_false(self): self.assertFalse(is_first_release(sdk_root, self.GROUP, self.MODULE)) +class TestGeneratedSourceCleanup(unittest.TestCase): + + def test_resources_module_cleanup_is_disabled(self): + self.assertFalse(should_remove_generated_source_code("azure-resourcemanager-resources")) + + def test_other_module_cleanup_is_enabled(self): + self.assertTrue(should_remove_generated_source_code("azure-resourcemanager-compute")) + + if __name__ == "__main__": unittest.main() diff --git a/eng/lintingconfigs/revapi/track2/revapi.json b/eng/lintingconfigs/revapi/track2/revapi.json index 6a3743edf739..79c95641432e 100644 --- a/eng/lintingconfigs/revapi/track2/revapi.json +++ b/eng/lintingconfigs/revapi/track2/revapi.json @@ -1038,6 +1038,51 @@ "old": "method com.azure.resourcemanager.compute.models.ExecutedValidation com.azure.resourcemanager.compute.models.ExecutedValidation::withStatus(com.azure.resourcemanager.compute.models.ValidationStatus)", "justification": "ExecutedValidation is output-only; fluent setter removed as part of immutable model cleanup." }, + { + "code": "java.method.removed", + "old": { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.resources\\.models\\..*\\:\\:with.*\\(.*\\).*" + }, + "justification": "Output-only immutable models' setters are removed." + }, + { + "code": "java.method.removed", + "old": { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.resources\\.models\\.PolicyLogInfo\\:\\:(ancestors|complianceReasonCode|policyAssignmentDisplayName|policyDefinitionDisplayName|policyDefinitionGroupNames|policyExemptionIds|policySetDefinitionCategory|policySetDefinitionDisplayName|resourceLocation)\\(\\)" + }, + "justification": "PolicyLogInfo properties were removed because they are not supported by the Policy service." + }, + { + "code": "java.method.visibilityReduced", + "old": { + "matcher": "regex", + "match": "method void com\\.azure\\.resourcemanager\\.resources\\.models\\..*\\:\\:\\\\(\\)" + }, + "justification": "Output-only immutable models' constructors are now private." + }, + { + "code": "java.class.removed", + "old": { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.resources\\.models\\..*ListResult" + }, + "justification": "Pageable models moved to implementation package. Unlikely used by user." + }, + { + "code": "java.class.removed", + "old": "class com.azure.resourcemanager.resources.models.AzureResourceBase", + "justification": "Unused legacy base model removed during TypeSpec migration." + }, + { + "code": "java.class.noLongerInheritsFromClass", + "old": { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.resources\\.models\\.ResourceReferenceExtended" + }, + "justification": "TypeSpec composition flattens ResourceReference properties instead of generating Java inheritance." + }, { "code" : "java.class.removed", "old" : "class com.azure.resourcemanager.containerregistry.models.AutoGeneratedDomainNameLabelScope", diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsGetSamples.java new file mode 100644 index 000000000000..476a467e99bd --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertConfigurations Get. + */ +public final class AlertConfigurationsGetSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertConfigurationById.json + */ + /** + * Sample code: GetAlertConfigurationById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurationById(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertConfigurations() + .getWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsListForScopeSamples.java new file mode 100644 index 000000000000..883f0920f8f6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsListForScopeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertConfigurations ListForScope. + */ +public final class AlertConfigurationsListForScopeSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertConfigurations.json + */ + /** + * Sample code: GetAlertConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertConfigurations(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertConfigurations() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..26b544ee48ba --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertConfigurationsUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.AlertConfigurationInner; +import com.azure.resourcemanager.authorization.models.TooManyOwnersAssignedToResourceAlertConfigurationProperties; + +/** + * Samples for AlertConfigurations Update. + */ +public final class AlertConfigurationsUpdateSamples { + /* + * x-ms-original-file: 2022-08-01-preview/UpdateAlertConfiguration.json + */ + /** + * Sample code: UpdateAlertConfiguration. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void updateAlertConfiguration(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertConfigurations() + .updateWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "TooManyOwnersAssignedToResource", + new AlertConfigurationInner().withProperties( + new TooManyOwnersAssignedToResourceAlertConfigurationProperties().withIsEnabled(true) + .withThresholdNumberOfOwners(2)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsGetSamples.java new file mode 100644 index 000000000000..ffa9a0c76e70 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertDefinitions Get. + */ +public final class AlertDefinitionsGetSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertDefinitionById.json + */ + /** + * Sample code: GetAlertDefinitionById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitionById(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertDefinitions() + .getWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsListForScopeSamples.java new file mode 100644 index 000000000000..a7ac66361ee0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertDefinitionsListForScopeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertDefinitions ListForScope. + */ +public final class AlertDefinitionsListForScopeSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertDefinitions.json + */ + /** + * Sample code: GetAlertDefinitions. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertDefinitions(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertDefinitions() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsGetSamples.java new file mode 100644 index 000000000000..df1560a7f5a9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertIncidents Get. + */ +public final class AlertIncidentsGetSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertIncidentById.json + */ + /** + * Sample code: GetAlertIncidentById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidentById(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertIncidents() + .getWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "TooManyOwnersAssignedToResource", + "5cf9ee65-d22e-4784-8b17-3de1c3b7bdcc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsListForScopeSamples.java new file mode 100644 index 000000000000..111f27202c69 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsListForScopeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertIncidents ListForScope. + */ +public final class AlertIncidentsListForScopeSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertIncidents.json + */ + /** + * Sample code: GetAlertIncidents. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertIncidents(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertIncidents() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsRemediateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsRemediateSamples.java new file mode 100644 index 000000000000..c8488ce767f0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertIncidentsRemediateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertIncidents Remediate. + */ +public final class AlertIncidentsRemediateSamples { + /* + * x-ms-original-file: 2022-08-01-preview/RemediateAlertIncident.json + */ + /** + * Sample code: RemediateAlertIncident. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void remediateAlertIncident(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertIncidents() + .remediateWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "DuplicateRoleCreated", + "0645231d-16ba-4ebf-851a-0875df4052bd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertOperationGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertOperationGetSamples.java new file mode 100644 index 000000000000..ddfdc3e692d4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for AlertOperation Get. + */ +public final class AlertOperationGetSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertOperationById.json + */ + /** + * Sample code: GetAlertOperation. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertOperation(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlertOperations() + .getWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "{operationId}", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsGetSamples.java new file mode 100644 index 000000000000..809e810fcf7c --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Alerts Get. + */ +public final class AlertsGetSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlertById.json + */ + /** + * Sample code: GetAlertById. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlertById(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlerts() + .getWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "TooManyOwnersAssignedToResource", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsListForScopeSamples.java new file mode 100644 index 000000000000..be07b6e7f6f8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsListForScopeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Alerts ListForScope. + */ +public final class AlertsListForScopeSamples { + /* + * x-ms-original-file: 2022-08-01-preview/GetAlerts.json + */ + /** + * Sample code: GetAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getAlerts(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlerts() + .listForScope("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshAllSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshAllSamples.java new file mode 100644 index 000000000000..c599d6289edc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshAllSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Alerts RefreshAll. + */ +public final class AlertsRefreshAllSamples { + /* + * x-ms-original-file: 2022-08-01-preview/RefreshAllAlerts.json + */ + /** + * Sample code: RefreshAllAlerts. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAllAlerts(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlerts() + .refreshAll("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshSamples.java new file mode 100644 index 000000000000..4dee9a487189 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsRefreshSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Alerts Refresh. + */ +public final class AlertsRefreshSamples { + /* + * x-ms-original-file: 2022-08-01-preview/RefreshAlert.json + */ + /** + * Sample code: RefreshAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void refreshAlert(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlerts() + .refresh("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", "AzureRolesAssignedOutsidePimAlert", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsUpdateSamples.java new file mode 100644 index 000000000000..fe5bcd4f65bb --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/AlertsUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.AlertInner; + +/** + * Samples for Alerts Update. + */ +public final class AlertsUpdateSamples { + /* + * x-ms-original-file: 2022-08-01-preview/UpdateAlert.json + */ + /** + * Sample code: DeactivateAlert. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deactivateAlert(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getAlerts() + .updateWithResponse("subscriptions/afa2a084-766f-4003-8ae1-c4aeb893a99f", + "TooManyPermanentOwnersAssignedToResource", new AlertInner().withIsActive(false), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ClassicAdministratorsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ClassicAdministratorsListSamples.java new file mode 100644 index 000000000000..bef6c0942c59 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ClassicAdministratorsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for ClassicAdministrators List. + */ +public final class ClassicAdministratorsListSamples { + /* + * x-ms-original-file: 2015-07-01/GetClassicAdministrators.json + */ + /** + * Sample code: List classic administrators. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listClassicAdministrators(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getClassicAdministrators().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsCreateOrUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e26331830627 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.authorization.fluent.models.DenyAssignmentInner; +import com.azure.resourcemanager.authorization.models.DenyAssignmentEffect; +import com.azure.resourcemanager.authorization.models.DenyAssignmentPermission; +import com.azure.resourcemanager.authorization.models.DenyAssignmentPrincipal; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; + +/** + * Samples for DenyAssignments CreateOrUpdate. + */ +public final class DenyAssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-07-01-preview/DenyAssignments_CreateForSubscription.json + */ + /** + * Sample code: Create deny assignment for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + createDenyAssignmentForSubscription(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .createOrUpdateWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "64b75d79-7a26-4341-944e-4f1a19f0e6ca", + new DenyAssignmentInner().withDenyAssignmentName("Deny delete on critical resources") + .withDescription("Prevent all users from deleting critical resources in the subscription.") + .withPermissions(Arrays.asList(new DenyAssignmentPermission().withActions(Arrays.asList("*/delete")) + .withNotActions(Arrays.asList()) + .withDataActions(Arrays.asList()) + .withNotDataActions(Arrays.asList()))) + .withDoNotApplyToChildScopes(false) + .withPrincipals( + Arrays.asList(new DenyAssignmentPrincipal().withId("00000000-0000-0000-0000-000000000000") + .withType(BinaryData.fromBytes("SystemDefined".getBytes(StandardCharsets.UTF_8))))) + .withExcludePrincipals( + Arrays.asList(new DenyAssignmentPrincipal().withId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withType(BinaryData.fromBytes("ServicePrincipal".getBytes(StandardCharsets.UTF_8))))) + .withDenyAssignmentEffect(DenyAssignmentEffect.ENFORCED), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..3372ed1c54a7 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments Delete. + */ +public final class DenyAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2024-07-01-preview/DenyAssignments_Delete.json + */ + /** + * Sample code: Delete deny assignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteDenyAssignment(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .deleteWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "64b75d79-7a26-4341-944e-4f1a19f0e6ca", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetByIdSamples.java new file mode 100644 index 000000000000..07199e527c6d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetByIdSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments GetById. + */ +public final class DenyAssignmentsGetByIdSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetDenyAssignmentById.json + */ + /** + * Sample code: Get deny assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByID(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .getByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/rgname/providers/Microsoft.Authorization/denyAssignments/denyAssignmentId", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetSamples.java new file mode 100644 index 000000000000..c8d806ac4a44 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments Get. + */ +public final class DenyAssignmentsGetSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetDenyAssignmentByNameId.json + */ + /** + * Sample code: Get deny assignment by name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getDenyAssignmentByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .getWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/rgname", + "denyAssignmentId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..79c79b90c1c1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments ListByResourceGroup. + */ +public final class DenyAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetDenyAssignmentsForResourceGroup.json + */ + /** + * Sample code: List deny assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listDenyAssignmentsForResourceGroup(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .listByResourceGroup("rgname", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForResourceSamples.java new file mode 100644 index 000000000000..a36965889af8 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForResourceSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments ListForResource. + */ +public final class DenyAssignmentsListForResourceSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetDenyAssignmentsForResource.json + */ + /** + * Sample code: List deny assignments for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listDenyAssignmentsForResource(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .listForResource("rgname", "resourceProviderNamespace", "parentResourceType/parentResourceName", + "resourceType", "resourceName", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..136776b29589 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments ListForScope. + */ +public final class DenyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetDenyAssignmentByScope.json + */ + /** + * Sample code: List deny assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listDenyAssignmentsForScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getDenyAssignments() + .listForScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/rgname", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListSamples.java new file mode 100644 index 000000000000..331aa5e49664 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/DenyAssignmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for DenyAssignments List. + */ +public final class DenyAssignmentsListSamples { + /* + * x-ms-original-file: 2024-07-01-preview/GetAllDenyAssignments.json + */ + /** + * Sample code: List deny assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listDenyAssignmentsForSubscription(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getDenyAssignments().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/EligibleChildResourcesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/EligibleChildResourcesGetSamples.java new file mode 100644 index 000000000000..3932fe83cccc --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/EligibleChildResourcesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for EligibleChildResources Get. + */ +public final class EligibleChildResourcesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetEligibleChildResourcesByScope.json + */ + /** + * Sample code: GetEligibleChildResourcesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getEligibleChildResourcesByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getEligibleChildResources() + .get("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "resourceType eq 'resourcegroup'", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/GlobalAdministratorElevateAccessSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/GlobalAdministratorElevateAccessSamples.java new file mode 100644 index 000000000000..df115d214123 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/GlobalAdministratorElevateAccessSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for GlobalAdministrator ElevateAccess. + */ +public final class GlobalAdministratorElevateAccessSamples { + /* + * x-ms-original-file: 2015-07-01/ElevateAccess.json + */ + /** + * Sample code: Elevate access global administrator. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + elevateAccessGlobalAdministrator(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getGlobalAdministrators() + .elevateAccessWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..bb388d0d9ed9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Permissions ListByResourceGroup. + */ +public final class PermissionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2022-05-01-preview/GetPermissions.json + */ + /** + * Sample code: List permissions for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listPermissionsForResourceGroup(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getPermissions().listByResourceGroup("rgname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListForResourceSamples.java new file mode 100644 index 000000000000..81463f78c689 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/PermissionsListForResourceSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for Permissions ListForResource. + */ +public final class PermissionsListForResourceSamples { + /* + * x-ms-original-file: 2022-05-01-preview/GetResourcePermissions.json + */ + /** + * Sample code: List permissions for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listPermissionsForResource(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getPermissions() + .listForResource("rgname", "rpnamespace", "parentResourcePath", "resourceType", "resourceName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataGetSamples.java new file mode 100644 index 000000000000..9c7ad5799991 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for ProviderOperationsMetadata Get. + */ +public final class ProviderOperationsMetadataGetSamples { + /* + * x-ms-original-file: 2022-04-01/GetProviderOperationsRP.json + */ + /** + * Sample code: List provider operations metadata for resource provider. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForResourceProvider( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getProviderOperationsMetadatas() + .getWithResponse("resourceProviderNamespace", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataListSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataListSamples.java new file mode 100644 index 000000000000..0a5a9dcd33b0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/ProviderOperationsMetadataListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for ProviderOperationsMetadata List. + */ +public final class ProviderOperationsMetadataListSamples { + /* + * x-ms-original-file: 2022-04-01/GetAllProviderOperations.json + */ + /** + * Sample code: List provider operations metadata for all resource providers. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void listProviderOperationsMetadataForAllResourceProviders( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getProviderOperationsMetadatas().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesGetSamples.java new file mode 100644 index 000000000000..77c3a9bdfe1d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentScheduleInstances Get. + */ +public final class RoleAssignmentScheduleInstancesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentScheduleInstanceByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleInstances() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "ed9b8180-cef7-4c77-a63c-b8566ecfc412", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java new file mode 100644 index 000000000000..71cd117a57bf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleInstancesListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentScheduleInstances ListForScope. + */ +public final class RoleAssignmentScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentScheduleInstancesByScope( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleInstances() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCancelSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCancelSamples.java new file mode 100644 index 000000000000..bec2a4e943e9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCancelSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentScheduleRequests Cancel. + */ +public final class RoleAssignmentScheduleRequestsCancelSamples { + /* + * x-ms-original-file: 2024-09-01-preview/CancelRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleRequests() + .cancelWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCreateSamples.java new file mode 100644 index 000000000000..7011adb2998f --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsCreateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.models.RequestType; +import com.azure.resourcemanager.authorization.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.models.Type; +import java.time.OffsetDateTime; + +/** + * Samples for RoleAssignmentScheduleRequests Create. + */ +public final class RoleAssignmentScheduleRequestsCreateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/PutRoleAssignmentScheduleRequest.json + */ + /** + * Sample code: PutRoleAssignmentScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + putRoleAssignmentScheduleRequest(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleRequests() + .createWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + new RoleAssignmentScheduleRequestInner().withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo(new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration(new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsGetSamples.java new file mode 100644 index 000000000000..1bfc4d108472 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentScheduleRequests Get. + */ +public final class RoleAssignmentScheduleRequestsGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentScheduleRequestByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleRequests() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java new file mode 100644 index 000000000000..ac20f9cef2de --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentScheduleRequests ListForScope. + */ +public final class RoleAssignmentScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleAssignmentScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentScheduleRequestByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleRequests() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsValidateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsValidateSamples.java new file mode 100644 index 000000000000..a2c42b52d060 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentScheduleRequestsValidateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleRequestInner; +import com.azure.resourcemanager.authorization.models.RequestType; +import com.azure.resourcemanager.authorization.models.RoleAssignmentScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.models.RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.models.Type; +import java.time.OffsetDateTime; + +/** + * Samples for RoleAssignmentScheduleRequests Validate. + */ +public final class RoleAssignmentScheduleRequestsValidateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/ValidateRoleAssignmentScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleAssignmentScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleAssignmentScheduleRequestByName( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentScheduleRequests() + .validateWithResponse("subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "fea7a502-9a96-4806-a26f-eee560e52045", + new RoleAssignmentScheduleRequestInner().withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.SELF_ACTIVATE) + .withScheduleInfo(new RoleAssignmentScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:35:27.91Z")) + .withExpiration(new RoleAssignmentScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("PT8H"))) + .withLinkedRoleEligibilityScheduleId("b1477448-2cc6-4ceb-93b4-54a202a89413") + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesGetSamples.java new file mode 100644 index 000000000000..032427948148 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentSchedules Get. + */ +public final class RoleAssignmentSchedulesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentScheduleByName.json + */ + /** + * Sample code: GetRoleAssignmentScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentScheduleByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentSchedules() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "c9e264ff-3133-4776-a81a-ebc7c33c8ec6", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesListForScopeSamples.java new file mode 100644 index 000000000000..7575dcc5b497 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentSchedulesListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignmentSchedules ListForScope. + */ +public final class RoleAssignmentSchedulesListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleAssignmentSchedulesByScope.json + */ + /** + * Sample code: GetRoleAssignmentSchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentSchedulesByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignmentSchedules() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateByIdSamples.java new file mode 100644 index 000000000000..8681498bf2e0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateByIdSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.models.PrincipalType; +import com.azure.resourcemanager.authorization.models.RoleAssignmentCreateParameters; + +/** + * Samples for RoleAssignments CreateById. + */ +public final class RoleAssignmentsCreateByIdSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_CreateById.json + */ + /** + * Sample code: Create or update role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + createOrUpdateRoleAssignmentByID(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .createByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + new RoleAssignmentCreateParameters() + .withRoleDefinitionId( + "/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateSamples.java new file mode 100644 index 000000000000..1fb2274d6fc1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsCreateSamples.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.models.PrincipalType; +import com.azure.resourcemanager.authorization.models.RoleAssignmentCreateParameters; + +/** + * Samples for RoleAssignments Create. + */ +public final class RoleAssignmentsCreateSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_CreateForSubscription.json + */ + /** + * Sample code: Create role assignment for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + createRoleAssignmentForSubscription(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .createWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "05c5a614-a7d6-4502-b150-c2fb455033ff", + new RoleAssignmentCreateParameters().withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_CreateForResourceGroup.json + */ + /** + * Sample code: Create role assignment for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + createRoleAssignmentForResourceGroup(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .createWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg", + "05c5a614-a7d6-4502-b150-c2fb455033ff", + new RoleAssignmentCreateParameters().withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_CreateForResource.json + */ + /** + * Sample code: Create role assignment for resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + createRoleAssignmentForResource(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .createWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/resourceGroups/testrg/providers/Microsoft.DocumentDb/databaseAccounts/test-db-account", + "05c5a614-a7d6-4502-b150-c2fb455033ff", + new RoleAssignmentCreateParameters().withRoleDefinitionId( + "/subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleDefinitions/0b5fe924-9a61-425c-96af-cfe6e287ca2d") + .withPrincipalId("ce2ce14e-85d7-4629-bdbc-454d0519d987") + .withPrincipalType(PrincipalType.USER), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteByIdSamples.java new file mode 100644 index 000000000000..b1c3e3590647 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteByIdSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments DeleteById. + */ +public final class RoleAssignmentsDeleteByIdSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_DeleteById.json + */ + /** + * Sample code: Delete role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignmentByID(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .deleteByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..a3218d817fb0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments Delete. + */ +public final class RoleAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_Delete.json + */ + /** + * Sample code: Delete role assignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleAssignment(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .deleteWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetByIdSamples.java new file mode 100644 index 000000000000..8c5953303adf --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetByIdSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments GetById. + */ +public final class RoleAssignmentsGetByIdSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_GetById.json + */ + /** + * Sample code: Get role assignment by ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleAssignmentByID(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .getByIdWithResponse( + "subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2/providers/Microsoft.Authorization/roleAssignments/b0f43c54-e787-4862-89b1-a653fa9cf747", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetSamples.java new file mode 100644 index 000000000000..83de78d6ccad --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments Get. + */ +public final class RoleAssignmentsGetSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_Get.json + */ + /** + * Sample code: Get role assignment by scope and name. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleAssignmentByScopeAndName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .getWithResponse("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", + "b0f43c54-e787-4862-89b1-a653fa9cf747", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListByResourceGroupSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c2703c576bb9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments ListByResourceGroup. + */ +public final class RoleAssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_ListForResourceGroup.json + */ + /** + * Sample code: List role assignments for resource group. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listRoleAssignmentsForResourceGroup(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .listByResourceGroup("testrg", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForResourceSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForResourceSamples.java new file mode 100644 index 000000000000..aaf67d29b0d3 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForResourceSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments ListForResource. + */ +public final class RoleAssignmentsListForResourceSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_ListForResource.json + */ + /** + * Sample code: List role assignments for a resource. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listRoleAssignmentsForAResource(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .listForResource("testrg", "Microsoft.DocumentDb", "databaseAccounts", "test-db-account", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..58d1ef2756e6 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments ListForScope. + */ +public final class RoleAssignmentsListForScopeSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_ListForScope.json + */ + /** + * Sample code: List role assignments for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listRoleAssignmentsForScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleAssignments() + .listForScope("subscriptions/a925f2f7-5c63-4b7b-8799-25a5f97bc3b2", null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListSamples.java new file mode 100644 index 000000000000..b11862b97005 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleAssignmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleAssignments List. + */ +public final class RoleAssignmentsListSamples { + /* + * x-ms-original-file: 2022-04-01/RoleAssignments_ListForSubscription.json + */ + /** + * Sample code: List role assignments for subscription. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listRoleAssignmentsForSubscription(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getRoleAssignments().list(null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsCreateOrUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..649f3018f0b1 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleDefinitionInner; + +/** + * Samples for RoleDefinitions CreateOrUpdate. + */ +public final class RoleDefinitionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2022-05-01-preview/PutRoleDefinition.json + */ + /** + * Sample code: Create role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void createRoleDefinition(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleDefinitions() + .createOrUpdateWithResponse("scope", "roleDefinitionId", new RoleDefinitionInner(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsDeleteSamples.java new file mode 100644 index 000000000000..3091b52543ec --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleDefinitions Delete. + */ +public final class RoleDefinitionsDeleteSamples { + /* + * x-ms-original-file: 2022-05-01-preview/DeleteRoleDefinition.json + */ + /** + * Sample code: Delete role definition. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void deleteRoleDefinition(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleDefinitions() + .deleteWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetByIdSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetByIdSamples.java new file mode 100644 index 000000000000..7bd012b5a0c0 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetByIdSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleDefinitions GetById. + */ +public final class RoleDefinitionsGetByIdSamples { + /* + * x-ms-original-file: 2022-05-01-preview/GetRoleDefinitionByRoleId.json + */ + /** + * Sample code: Get role definition by role ID. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionByRoleID(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleDefinitions() + .getByIdWithResponse("roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetSamples.java new file mode 100644 index 000000000000..a676a6aae063 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleDefinitions Get. + */ +public final class RoleDefinitionsGetSamples { + /* + * x-ms-original-file: 2022-05-01-preview/GetRoleDefinitionById.json + */ + /** + * Sample code: Get role definition by id. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleDefinitionById(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleDefinitions() + .getWithResponse("scope", "roleDefinitionId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsListSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsListSamples.java new file mode 100644 index 000000000000..56056be1f1b9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleDefinitionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleDefinitions List. + */ +public final class RoleDefinitionsListSamples { + /* + * x-ms-original-file: 2022-05-01-preview/GetRoleDefinitionAtScope.json + */ + /** + * Sample code: List role definitions for scope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + listRoleDefinitionsForScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient().getRoleDefinitions().list("scope", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesGetSamples.java new file mode 100644 index 000000000000..e741e60e6efe --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilityScheduleInstances Get. + */ +public final class RoleEligibilityScheduleInstancesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilityScheduleInstanceByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstanceByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleEligibilityScheduleInstanceByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleInstances() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "21e4b59a-0499-4fe0-a3c3-43a3055b773a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java new file mode 100644 index 000000000000..f2cbea05dc99 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleInstancesListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilityScheduleInstances ListForScope. + */ +public final class RoleEligibilityScheduleInstancesListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilityScheduleInstancesByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleInstancesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleEligibilityScheduleInstancesByScope( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleInstances() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCancelSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCancelSamples.java new file mode 100644 index 000000000000..caef30d05d9e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCancelSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilityScheduleRequests Cancel. + */ +public final class RoleEligibilityScheduleRequestsCancelSamples { + /* + * x-ms-original-file: 2024-09-01-preview/CancelRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: CancelRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void cancelRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleRequests() + .cancelWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCreateSamples.java new file mode 100644 index 000000000000..0e280f2b560b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsCreateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.models.RequestType; +import com.azure.resourcemanager.authorization.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.models.Type; +import java.time.OffsetDateTime; + +/** + * Samples for RoleEligibilityScheduleRequests Create. + */ +public final class RoleEligibilityScheduleRequestsCreateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/PutRoleEligibilityScheduleRequest.json + */ + /** + * Sample code: PutRoleEligibilityScheduleRequest. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + putRoleEligibilityScheduleRequest(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleRequests() + .createWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + new RoleEligibilityScheduleRequestInner().withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo(new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration(new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsGetSamples.java new file mode 100644 index 000000000000..1c00c317f518 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilityScheduleRequests Get. + */ +public final class RoleEligibilityScheduleRequestsGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleEligibilityScheduleRequestByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleRequests() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java new file mode 100644 index 000000000000..df92a2d1a07e --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilityScheduleRequests ListForScope. + */ +public final class RoleEligibilityScheduleRequestsListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilityScheduleRequestByScope.json + */ + /** + * Sample code: GetRoleEligibilityScheduleRequestByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleEligibilityScheduleRequestByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleRequests() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('A3BB8764-CB92-4276-9D2A-CA1E895E55EA')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsValidateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsValidateSamples.java new file mode 100644 index 000000000000..943cb00aca68 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilityScheduleRequestsValidateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleEligibilityScheduleRequestInner; +import com.azure.resourcemanager.authorization.models.RequestType; +import com.azure.resourcemanager.authorization.models.RoleEligibilityScheduleRequestPropertiesScheduleInfo; +import com.azure.resourcemanager.authorization.models.RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration; +import com.azure.resourcemanager.authorization.models.Type; +import java.time.OffsetDateTime; + +/** + * Samples for RoleEligibilityScheduleRequests Validate. + */ +public final class RoleEligibilityScheduleRequestsValidateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/ValidateRoleEligibilityScheduleRequestByName.json + */ + /** + * Sample code: ValidateRoleEligibilityScheduleRequestByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void validateRoleEligibilityScheduleRequestByName( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilityScheduleRequests() + .validateWithResponse("subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "64caffb6-55c0-4deb-a585-68e948ea1ad6", + new RoleEligibilityScheduleRequestInner().withRoleDefinitionId( + "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/roleDefinitions/c8d4ff99-41c3-41a8-9f60-21dfdad59608") + .withPrincipalId("a3bb8764-cb92-4276-9d2a-ca1e895e55ea") + .withRequestType(RequestType.ADMIN_ASSIGN) + .withScheduleInfo(new RoleEligibilityScheduleRequestPropertiesScheduleInfo() + .withStartDateTime(OffsetDateTime.parse("2020-09-09T21:31:27.91Z")) + .withExpiration(new RoleEligibilityScheduleRequestPropertiesScheduleInfoExpiration() + .withType(Type.AFTER_DURATION) + .withDuration("P365D"))) + .withCondition( + "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'") + .withConditionVersion("1.0"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesGetSamples.java new file mode 100644 index 000000000000..6422ebc99c41 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilitySchedules Get. + */ +public final class RoleEligibilitySchedulesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilityScheduleByName.json + */ + /** + * Sample code: GetRoleEligibilityScheduleByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleEligibilityScheduleByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilitySchedules() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "b1477448-2cc6-4ceb-93b4-54a202a89413", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesListForScopeSamples.java new file mode 100644 index 000000000000..d5d1cbf2b3a4 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleEligibilitySchedulesListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleEligibilitySchedules ListForScope. + */ +public final class RoleEligibilitySchedulesListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleEligibilitySchedulesByScope.json + */ + /** + * Sample code: GetRoleEligibilitySchedulesByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleEligibilitySchedulesByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleEligibilitySchedules() + .listForScope("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", + "assignedTo('a3bb8764-cb92-4276-9d2a-ca1e895e55ea')", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesDeleteSamples.java new file mode 100644 index 000000000000..558021a88e7d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicies Delete. + */ +public final class RoleManagementPoliciesDeleteSamples { + /* + * x-ms-original-file: 2024-09-01-preview/DeleteRoleManagementPolicy.json + */ + /** + * Sample code: DeleteRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + deleteRoleManagementPolicy(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .deleteWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesGetSamples.java new file mode 100644 index 000000000000..8490b614f17d --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicies Get. + */ +public final class RoleManagementPoliciesGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleManagementPolicyByName.json + */ + /** + * Sample code: GetRoleManagementPolicyByName. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleManagementPolicyByName(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesListForScopeSamples.java new file mode 100644 index 000000000000..07a15deac2be --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicies ListForScope. + */ +public final class RoleManagementPoliciesListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleManagementPolicyByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyByRoleDefinitionFilter. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getRoleManagementPolicyByRoleDefinitionFilter( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .listForScope("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesUpdateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesUpdateSamples.java new file mode 100644 index 000000000000..3de30fcecab9 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPoliciesUpdateSamples.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleManagementPolicyInner; +import com.azure.resourcemanager.authorization.models.ApprovalMode; +import com.azure.resourcemanager.authorization.models.ApprovalSettings; +import com.azure.resourcemanager.authorization.models.ApprovalStage; +import com.azure.resourcemanager.authorization.models.EnablementRules; +import com.azure.resourcemanager.authorization.models.ExcludedPrincipalTypes; +import com.azure.resourcemanager.authorization.models.NotificationDeliveryMechanism; +import com.azure.resourcemanager.authorization.models.NotificationLevel; +import com.azure.resourcemanager.authorization.models.PIMOnlyMode; +import com.azure.resourcemanager.authorization.models.PIMOnlyModeSettings; +import com.azure.resourcemanager.authorization.models.RecipientType; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyApprovalRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyAuthenticationContextRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyEnablementRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyExpirationRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyNotificationRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyPimOnlyModeRule; +import com.azure.resourcemanager.authorization.models.RoleManagementPolicyRuleTarget; +import com.azure.resourcemanager.authorization.models.UserSet; +import com.azure.resourcemanager.authorization.models.UserType; +import com.azure.resourcemanager.authorization.models.UsersOrServicePrincipalSet; +import com.azure.resourcemanager.authorization.models.UsersOrServicePrincipalSetUserType; +import java.util.Arrays; + +/** + * Samples for RoleManagementPolicies Update. + */ +public final class RoleManagementPoliciesUpdateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/PatchPartialRoleManagementPolicy.json + */ + /** + * Sample code: PatchPartialRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + patchPartialRoleManagementPolicy(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .updateWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner().withRules(Arrays.asList( + new RoleManagementPolicyExpirationRule().withId("Expiration_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule().withId("Notification_Admin_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-09-01-preview/PatchRoleManagementPolicyToEnablePIMOnlyMode.json + */ + /** + * Sample code: PatchRoleManagementPolicyToEnablePIMOnlyMode. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchRoleManagementPolicyToEnablePIMOnlyMode( + com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .updateWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner().withRules( + Arrays.asList(new RoleManagementPolicyPimOnlyModeRule().withId("PIMOnlyMode_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("all")) + .withLevel("Assignment") + .withTargetObjects(Arrays.asList()) + .withInheritableSettings(Arrays.asList("all")) + .withEnforcedSettings(Arrays.asList("all"))) + .withPimOnlyModeSettings(new PIMOnlyModeSettings().withMode(PIMOnlyMode.ENABLED) + .withExcludes(Arrays.asList( + new UsersOrServicePrincipalSet().withType(UsersOrServicePrincipalSetUserType.USER) + .withId("ec42a424-a0c0-4418-8788-d19bdeb03704"), + new UsersOrServicePrincipalSet().withType(UsersOrServicePrincipalSetUserType.GROUP) + .withId("00029dfb-0218-4e7a-9a85-c15dc0c880bc"), + new UsersOrServicePrincipalSet() + .withType(UsersOrServicePrincipalSetUserType.SERVICE_PRINCIPAL) + .withId("0000103d-1fc2-4ac8-81de-71517765655c"))) + .withExcludedAssignmentTypes( + Arrays.asList(ExcludedPrincipalTypes.SERVICE_PRINCIPALS_AS_TARGET))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-09-01-preview/PatchRoleManagementPolicy.json + */ + /** + * Sample code: PatchRoleManagementPolicy. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void patchRoleManagementPolicy(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicies() + .updateWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "570c3619-7688-4b34-b290-2b8bb3ccab2a", + new RoleManagementPolicyInner() + .withRules( + Arrays + .asList( + new RoleManagementPolicyExpirationRule().withId("Expiration_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withIsExpirationRequired(false) + .withMaximumDuration("P180D"), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_eligible@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyEnablementRule().withId("Enablement_Admin_Eligibility") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Eligibility")) + .withEnabledRules(Arrays.asList()), + new RoleManagementPolicyExpirationRule().withId("Expiration_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(false) + .withMaximumDuration("P90D"), + new RoleManagementPolicyEnablementRule().withId("Enablement_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules(Arrays.asList(EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION)), + new RoleManagementPolicyNotificationRule().withId("Notification_Admin_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("Admin") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withNotificationRecipients(Arrays.asList("approver_admin_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyExpirationRule().withId("Expiration_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsExpirationRequired(true) + .withMaximumDuration("PT7H"), + new RoleManagementPolicyEnablementRule().withId("Enablement_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withEnabledRules( + Arrays + .asList(EnablementRules.JUSTIFICATION, + EnablementRules.MULTI_FACTOR_AUTHENTICATION, + EnablementRules.TICKETING)), + new RoleManagementPolicyApprovalRule().withId("Approval_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withSetting( + new ApprovalSettings().withIsApprovalRequired(true) + .withIsApprovalRequiredForExtension(false) + .withIsRequestorJustificationRequired(true) + .withApprovalMode(ApprovalMode.SINGLE_STAGE) + .withApprovalStages( + Arrays + .asList( + new ApprovalStage().withApprovalStageTimeOutInDays(1) + .withIsApproverJustificationRequired(true) + .withEscalationTimeInMinutes(0) + .withPrimaryApprovers( + Arrays + .asList( + new UserSet().withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2385b0f3-5fa9-43cf-8ca4-b01dc97298cd") + .withDescription("amansw_new_group"), + new UserSet().withUserType(UserType.GROUP) + .withIsBackup(false) + .withId( + "2f4913c9-d15b-406a-9946-1d66a28f2690") + .withDescription("amansw_group"))) + .withIsEscalationEnabled(false)))), + new RoleManagementPolicyAuthenticationContextRule() + .withId("AuthenticationContext_EndUser_Assignment") + .withTarget( + new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withIsEnabled(false) + .withClaimValue(""), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Admin_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.ADMIN) + .withNotificationRecipients(Arrays.asList("admin_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Requestor_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.REQUESTOR) + .withNotificationRecipients(Arrays.asList("requestor_enduser_member@test.com")) + .withIsDefaultRecipientsEnabled(false), + new RoleManagementPolicyNotificationRule() + .withId("Notification_Approver_EndUser_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget().withCaller("EndUser") + .withOperations(Arrays.asList("All")) + .withLevel("Assignment")) + .withNotificationType(NotificationDeliveryMechanism.EMAIL) + .withNotificationLevel(NotificationLevel.CRITICAL) + .withRecipientType(RecipientType.APPROVER) + .withIsDefaultRecipientsEnabled(true), + new RoleManagementPolicyPimOnlyModeRule().withId("PIMOnlyMode_Admin_Assignment") + .withTarget(new RoleManagementPolicyRuleTarget() + .withCaller("Admin") + .withOperations(Arrays.asList("all")) + .withLevel("Assignment") + .withTargetObjects(Arrays.asList()) + .withInheritableSettings(Arrays.asList("all")) + .withEnforcedSettings(Arrays.asList("all"))) + .withPimOnlyModeSettings(new PIMOnlyModeSettings().withMode(PIMOnlyMode.ENABLED) + .withExcludes(Arrays.asList( + new UsersOrServicePrincipalSet() + .withType(UsersOrServicePrincipalSetUserType.USER) + .withId("ec42a424-a0c0-4418-8788-d19bdeb03704"), + new UsersOrServicePrincipalSet() + .withType(UsersOrServicePrincipalSetUserType.GROUP) + .withId("00029dfb-0218-4e7a-9a85-c15dc0c880bc"), + new UsersOrServicePrincipalSet() + .withType(UsersOrServicePrincipalSetUserType.SERVICE_PRINCIPAL) + .withId("0000103d-1fc2-4ac8-81de-71517765655c"))) + .withExcludedAssignmentTypes( + Arrays.asList(ExcludedPrincipalTypes.SERVICE_PRINCIPALS_AS_TARGET))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsCreateSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsCreateSamples.java new file mode 100644 index 000000000000..6578efa24f2b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsCreateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +import com.azure.resourcemanager.authorization.fluent.models.RoleManagementPolicyAssignmentInner; + +/** + * Samples for RoleManagementPolicyAssignments Create. + */ +public final class RoleManagementPolicyAssignmentsCreateSamples { + /* + * x-ms-original-file: 2024-09-01-preview/PutRoleManagementPolicyAssignment.json + */ + /** + * Sample code: PutRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + putRoleManagementPolicyAssignment(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicyAssignments() + .createWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + new RoleManagementPolicyAssignmentInner() + .withScope("/subscriptions/129ff972-28f8-46b8-a726-e497be039368") + .withRoleDefinitionId( + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleDefinitions/a1705bd2-3a8f-45a5-8683-466fcfd5cc24") + .withPolicyId( + "/subscriptions/129ff972-28f8-46b8-a726-e497be039368/providers/Microsoft.Authorization/roleManagementPolicies/b959d571-f0b5-4042-88a7-01be6cb22db9"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsDeleteSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..c411f72b3e0b --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicyAssignments Delete. + */ +public final class RoleManagementPolicyAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2024-09-01-preview/DeleteRoleManagementPolicyAssignment.json + */ + /** + * Sample code: DeleteRoleManagementPolicyAssignment. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + deleteRoleManagementPolicyAssignment(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicyAssignments() + .deleteWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsGetSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsGetSamples.java new file mode 100644 index 000000000000..071ebb0e4699 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicyAssignments Get. + */ +public final class RoleManagementPolicyAssignmentsGetSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleManagementPolicyAssignmentByName.json + */ + /** + * Sample code: GetConfigurations. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void getConfigurations(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicyAssignments() + .getWithResponse("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + "b959d571-f0b5-4042-88a7-01be6cb22db9_a1705bd2-3a8f-45a5-8683-466fcfd5cc24", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsListForScopeSamples.java b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsListForScopeSamples.java new file mode 100644 index 000000000000..17ff95bb3335 --- /dev/null +++ b/sdk/authorization/azure-resourcemanager-authorization/src/samples/java/com/azure/resourcemanager/authorization/generated/RoleManagementPolicyAssignmentsListForScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.authorization.generated; + +/** + * Samples for RoleManagementPolicyAssignments ListForScope. + */ +public final class RoleManagementPolicyAssignmentsListForScopeSamples { + /* + * x-ms-original-file: 2024-09-01-preview/GetRoleManagementPolicyAssignmentByScope.json + */ + /** + * Sample code: GetRoleManagementPolicyAssignmentByScope. + * + * @param manager Entry point to AuthorizationManager. + */ + public static void + getRoleManagementPolicyAssignmentByScope(com.azure.resourcemanager.authorization.AuthorizationManager manager) { + manager.roleServiceClient() + .getRoleManagementPolicyAssignments() + .listForScope("providers/Microsoft.Subscription/subscriptions/129ff972-28f8-46b8-a726-e497be039368", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/authorization/azure-resourcemanager-authorization/tsp-location.yaml b/sdk/authorization/azure-resourcemanager-authorization/tsp-location.yaml index 99efb99add10..1e5ac958944e 100644 --- a/sdk/authorization/azure-resourcemanager-authorization/tsp-location.yaml +++ b/sdk/authorization/azure-resourcemanager-authorization/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/authorization/resource-manager/Microsoft.Authorization/Authorization -commit: 9a1c1ab3df2e89863f4ed55e35e1ce28fd9823e5 -repo: Azure/azure-rest-api-specs +commit: 82532af56e2f78bce9e5d64794b3ceecdefa5c77 +repo: weidongxu-microsoft/azure-rest-api-specs additionalDirectories: diff --git a/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java b/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java index 98c3cb7ea7d3..bbfbead98cd0 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java +++ b/sdk/compute/azure-resourcemanager-compute/src/test/java/com/azure/resourcemanager/compute/VirtualMachineOperationsTests.java @@ -1019,6 +1019,7 @@ public void canForceDeleteVirtualMachine() { } @Test + @Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.") public void canCreateVirtualMachineWithDeleteOption() throws Exception { Region region = Region.US_WEST3; diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/test/java/com/azure/resourcemanager/samples/ResourceSampleTests.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/test/java/com/azure/resourcemanager/samples/ResourceSampleTests.java index 3f94fca0e899..c919a5a0dae1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/test/java/com/azure/resourcemanager/samples/ResourceSampleTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/test/java/com/azure/resourcemanager/samples/ResourceSampleTests.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.resources.samples.ManageResource; import com.azure.resourcemanager.resources.samples.ManageResourceGroup; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -47,6 +48,7 @@ public void testDeployUsingARMTemplateWithDeploymentOperations() throws Interrup } @Test + @Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.") public void testDeployUsingARMTemplateWithTags() throws IOException, IllegalAccessException { Assertions.assertTrue(DeployUsingARMTemplateWithTags.runSample(azureResourceManager)); } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java index fdd25988fff8..c6d24742ed2f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/test/java/com/azure/resourcemanager/AzureResourceManagerTests.java @@ -260,6 +260,7 @@ public void testDeployments() { * */ @Test + @Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.") public void testGenericResources() { // Create some resources NetworkSecurityGroup nsg = azureResourceManager.networkSecurityGroups() diff --git a/sdk/resources/azure-resourcemanager-resources/CHANGELOG.md b/sdk/resources/azure-resourcemanager-resources/CHANGELOG.md index aeb2d84b5cf8..36e2b7391868 100644 --- a/sdk/resources/azure-resourcemanager-resources/CHANGELOG.md +++ b/sdk/resources/azure-resourcemanager-resources/CHANGELOG.md @@ -2,10 +2,16 @@ ## 2.55.0-beta.1 (Unreleased) +- Package api-version 2026-07-01. + ### Features Added ### Breaking Changes +- Removed properties `ancestors`, `complianceReasonCode`, `policyAssignmentDisplayName`, `policyDefinitionDisplayName`, + `policyDefinitionGroupNames`, `policyExemptionIds`, `policySetDefinitionCategory`, `policySetDefinitionDisplayName`, and + `resourceLocation` from `PolicyLogInfo`, as they are not supported by the Policy service. + ### Bugs Fixed ### Other Changes diff --git a/sdk/resources/azure-resourcemanager-resources/assets.json b/sdk/resources/azure-resourcemanager-resources/assets.json index 76e4e2425334..1f84507b475b 100644 --- a/sdk/resources/azure-resourcemanager-resources/assets.json +++ b/sdk/resources/azure-resourcemanager-resources/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resources/azure-resourcemanager-resources", - "Tag": "java/resources/azure-resourcemanager-resources_5e481be4bc" + "Tag": "java/resources/azure-resourcemanager-resources_5d894004de" } diff --git a/sdk/resources/azure-resourcemanager-resources/customization/pom.xml b/sdk/resources/azure-resourcemanager-resources/customization/pom.xml new file mode 100644 index 000000000000..9c9f131804fa --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/customization/pom.xml @@ -0,0 +1,17 @@ + + + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + com.azure.resourcemanager + azure-resourcemanager-resources-customization + 1.0.0-beta.1 + 4.0.0 + diff --git a/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/DeploymentsCustomization.java b/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/DeploymentsCustomization.java new file mode 100644 index 000000000000..aaa3faccff5a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/DeploymentsCustomization.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.github.javaparser.ast.Modifier; +import org.slf4j.Logger; + +/** + * Code customization after deployments code generation. + */ +public class DeploymentsCustomization extends Customization { + @Override + public void customize(LibraryCustomization customization, Logger logger) { + customizeResourceReference( + customization.getPackage("com.azure.resourcemanager.resources.models").getClass("ResourceReference")); + } + + private static void customizeResourceReference(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + clazz.removeModifier(Modifier.Keyword.FINAL); + clazz.getConstructors() + .stream() + .filter(constructor -> constructor.getParameters().isEmpty()) + .forEach(constructor -> constructor.setModifiers(Modifier.Keyword.PROTECTED)); + })); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/PolicyCustomization.java b/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/PolicyCustomization.java new file mode 100644 index 000000000000..2e850f9b89d9 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/customization/src/main/java/PolicyCustomization.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.StaticJavaParser; +import com.github.javaparser.ast.Modifier; +import com.github.javaparser.ast.body.MethodDeclaration; +import org.slf4j.Logger; + +/** + * Code customization after code generation. + */ +public class PolicyCustomization extends Customization { + @Override + public void customize(LibraryCustomization customization, Logger logger) { + customizePolicyClient( + customization.getPackage("com.azure.resourcemanager.resources.fluent").getClass("PolicyClient")); + customizePolicyClientImpl( + customization.getPackage("com.azure.resourcemanager.resources.implementation") + .getClass("PolicyClientImpl")); + } + + private static void customizePolicyClient(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getInterfaceByName(customization.getClassName()).ifPresent(clazz -> { + if (clazz.getMethodsByName("getPolicyExemptions").isEmpty()) { + MethodDeclaration method = clazz.addMethod("getPolicyExemptions"); + method.setType("PolicyExemptionsClient"); + method.removeBody(); + method.setJavadocComment("Gets the PolicyExemptionsClient object to access its operations.\n\n" + + "@return the PolicyExemptionsClient object."); + } + })); + } + + private static void customizePolicyClientImpl(ClassCustomization customization) { + customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> { + if (clazz.getMethodsByName("getPolicyExemptions").isEmpty()) { + ast.addImport("com.azure.resourcemanager.resources.fluent.PolicyExemptionsClient"); + clazz.addField("PolicyExemptionsClient", "policyExemptions", Modifier.Keyword.PRIVATE, + Modifier.Keyword.FINAL); + + MethodDeclaration method = clazz.addMethod("getPolicyExemptions", Modifier.Keyword.PUBLIC); + method.addMarkerAnnotation("Override"); + method.setType("PolicyExemptionsClient"); + method.setBody(StaticJavaParser.parseBlock("{ return this.policyExemptions; }")); + method.setJavadocComment("Gets the PolicyExemptionsClient object to access its operations.\n\n" + + "@return the PolicyExemptionsClient object."); + + clazz.getConstructors() + .forEach(constructor -> constructor.getBody() + .addStatement("this.policyExemptions = new PolicyExemptionsClientImpl(this);")); + } + })); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java index f61b7e5446ee..9b71cfea2383 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/AuthorizationOperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesClient.java index 45fff1ad426d..edefcfc357b1 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesManagementClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesManagementClient.java index 68078dad2b46..6f0ea6d6c980 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesManagementClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ChangesManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesClient.java index c7f7915fd5b7..3516e96f10a2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -17,60 +17,58 @@ */ public interface DataBoundariesClient { /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. + * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> putWithResponseAsync(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition); + Mono> getScopeWithResponseAsync(String scope, DefaultName defaultParameter); /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition on successful completion of {@link Mono}. + * @return data boundary at specified scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition); + Mono getScopeAsync(String scope, DefaultName defaultParameter); /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition along with {@link Response}. + * @return data boundary at specified scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition, Context context); + Response getScopeWithResponse(String scope, DefaultName defaultParameter, + Context context); /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition. + * @return data boundary at specified scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataBoundaryDefinitionInner put(DefaultName defaultParameter, DataBoundaryDefinitionInner dataBoundaryDefinition); + DataBoundaryDefinitionInner getScope(String scope, DefaultName defaultParameter); /** * Get data boundary of tenant. @@ -122,56 +120,58 @@ Response putWithResponse(DefaultName defaultParamet DataBoundaryDefinitionInner getTenant(DefaultName defaultParameter); /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. + * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getScopeWithResponseAsync(String scope, DefaultName defaultParameter); + Mono> putWithResponseAsync(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition); /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope on successful completion of {@link Mono}. + * @return a data boundary definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getScopeAsync(String scope, DefaultName defaultParameter); + Mono putAsync(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition); /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @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 data boundary at specified scope along with {@link Response}. + * @return a data boundary definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getScopeWithResponse(String scope, DefaultName defaultParameter, - Context context); + Response putWithResponse(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition, Context context); /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope. + * @return a data boundary definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataBoundaryDefinitionInner getScope(String scope, DefaultName defaultParameter); + DataBoundaryDefinitionInner put(DefaultName defaultParameter, DataBoundaryDefinitionInner dataBoundaryDefinition); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesManagementClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesManagementClient.java index 613338378cc6..afc1db7e196d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesManagementClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -12,14 +12,14 @@ */ public interface DataBoundariesManagementClient { /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataPolicyManifestsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataPolicyManifestsClient.java index 503a62f7c37e..8a1c82857151 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataPolicyManifestsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DataPolicyManifestsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -75,70 +75,70 @@ public interface DataPolicyManifestsClient { DataPolicyManifestInner getByPolicyMode(String policyMode); /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 data policy manifests as paginated response with {@link PagedFlux}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String filter); /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * * @throws com.azure.core.management.exception.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 data policy manifests as paginated response with {@link PagedFlux}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * * @throws com.azure.core.management.exception.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 data policy manifests as paginated response with {@link PagedIterable}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests as paginated response with {@link PagedIterable}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, Context context); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java index ce4b1ae10af2..dae2a9192755 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -20,7 +20,7 @@ public interface DeploymentOperationsClient { /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -35,7 +35,7 @@ Mono> getAtScopeWithResponseAsync(String scop /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -49,7 +49,7 @@ Mono> getAtScopeWithResponseAsync(String scop /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param context The context to associate with this operation. @@ -65,7 +65,7 @@ Response getAtScopeWithResponse(String scope, String d /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,7 +79,7 @@ Response getAtScopeWithResponse(String scope, String d /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,7 +93,7 @@ Response getAtScopeWithResponse(String scope, String d /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,7 +106,7 @@ Response getAtScopeWithResponse(String scope, String d /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -119,7 +119,7 @@ Response getAtScopeWithResponse(String scope, String d /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @param context The context to associate with this operation. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksClient.java index 897e1003d9ad..0a7a481a9557 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -32,276 +32,325 @@ public interface DeploymentStacksClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName); /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String deploymentStackName); /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the Deployment stack with the given name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String deploymentStackName, + Context context); /** - * Lists all the Deployment stacks within the specified Subscription. + * Gets the Deployment stack with the given name. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the Deployment stack with the given name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentStackInner getByResourceGroup(String resourceGroupName, String deploymentStackName); /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedIterable}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedIterable}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all the Deployment stacks within the specified Management Group. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedFlux}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupAsync(String managementGroupId); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroup(String managementGroupId); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroup(String managementGroupId, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentStackName, DeploymentStackInner deploymentStack); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack The content of the action request. + * @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 PollerFlux} for polling of deployment stack object. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtResourceGroupAsync( - String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack); + SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 deployment stack object. + * @return the Deployment stack validation result on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtResourceGroup( - String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono validateStackAtResourceGroupAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param context The context to associate with this operation. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 deployment stack object. + * @return the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtResourceGroup( - String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack The content of the action request. + * @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 deployment stack object on successful completion of {@link Mono}. + * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, - DeploymentStackInner deploymentStack); + DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object. + * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupName, String deploymentStackName, - DeploymentStackInner deploymentStack); + Mono>> createOrUpdateAtResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param context The context to associate with this operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object. + * @return the {@link PollerFlux} for polling of deployment stack object. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupName, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtResourceGroupAsync( + String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of deployment stack object. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentStackName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtResourceGroup( + String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack); + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @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 deployment stack object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtResourceGroup( + String resourceGroupName, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope on successful completion of {@link Mono}. + * @return deployment stack object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String deploymentStackName); + Mono createOrUpdateAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param context The context to associate with this operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope along with {@link Response}. + * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String deploymentStackName, - Context context); + DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope. + * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner getByResourceGroup(String resourceGroupName, String deploymentStackName); + DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -323,7 +372,7 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -345,7 +394,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -359,7 +408,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -373,7 +422,7 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentStackName); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -397,7 +446,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String Context context); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -419,7 +468,7 @@ Mono deleteAsync(String resourceGroupName, String deploymentStackName, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -433,7 +482,7 @@ Mono deleteAsync(String resourceGroupName, String deploymentStackName, Mono deleteAsync(String resourceGroupName, String deploymentStackName); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -446,7 +495,7 @@ Mono deleteAsync(String resourceGroupName, String deploymentStackName, void delete(String resourceGroupName, String deploymentStackName); /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -469,362 +518,301 @@ void delete(String resourceGroupName, String deploymentStackName, Context context); /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the 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 deployment stack object along with {@link Response} on successful completion of {@link Mono}. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack); + Mono> + exportTemplateAtResourceGroupWithResponseAsync(String resourceGroupName, String deploymentStackName); /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the 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 PollerFlux} for polling of deployment stack object. + * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentStackInner> - beginCreateOrUpdateAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono exportTemplateAtResourceGroupAsync(String resourceGroupName, + String deploymentStackName); /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @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 deployment stack object. + * @return export Template specific properties of the Deployment stack along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> - beginCreateOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtResourceGroupWithResponse(String resourceGroupName, + String deploymentStackName, Context context); /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @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 deployment stack object. + * @return export Template specific properties of the Deployment stack. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtSubscription( - String deploymentStackName, DeploymentStackInner deploymentStack, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(String resourceGroupName, + String deploymentStackName); /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the 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 deployment stack object on successful completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack); + Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName); /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the 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 deployment stack object. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); + Mono getAtSubscriptionAsync(String deploymentStackName); /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @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 deployment stack object. + * @return the Deployment stack with the given name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, - Context context); + Response getAtSubscriptionWithResponse(String deploymentStackName, Context context); /** - * Gets a Deployment stack with a given name at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the Deployment stack with the given name. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName); + DeploymentStackInner getAtSubscription(String deploymentStackName); /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtSubscriptionAsync(String deploymentStackName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope along with {@link Response}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtSubscriptionWithResponse(String deploymentStackName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner getAtSubscription(String deploymentStackName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); + Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. - * - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName); + PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName); + SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context); - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. - * - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtSubscriptionAsync(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); + SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, + Context context); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtSubscriptionAsync(String deploymentStackName); + Mono validateStackAtSubscriptionAsync(String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscription(String deploymentStackName); + DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @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 Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscription(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context); + DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner deploymentStack, Context context); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack); + Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtManagementGroupAsync( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); + PollerFlux, DeploymentStackInner> + beginCreateOrUpdateAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); + SyncPoller, DeploymentStackInner> + beginCreateOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @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. @@ -832,116 +820,55 @@ SyncPoller, DeploymentStackInner> beginCreateOr * @return the {@link SyncPoller} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); + SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtSubscription( + String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack); - - /** - * Creates or updates a Deployment stack at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the 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 deployment stack object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, + Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param context The context to associate with this operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context); - - /** - * Gets a Deployment stack with a given name at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName); - - /** - * Gets a Deployment stack with a given name at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String managementGroupId, String deploymentStackName); + DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Gets a Deployment stack with a given name at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse(String managementGroupId, - String deploymentStackName, Context context); - - /** - * Gets a Deployment stack with a given name at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope. + * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackInner getAtManagementGroup(String managementGroupId, String deploymentStackName); + DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, + Context context); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -954,16 +881,15 @@ Response getAtManagementGroupWithResponse(String managemen * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -976,16 +902,15 @@ Mono>> deleteAtManagementGroupWithResponseAsync(String * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -993,14 +918,12 @@ PollerFlux, Void> beginDeleteAtManagementGroupAsync(String mana * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, - String deploymentStackName); + PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1008,14 +931,12 @@ PollerFlux, Void> beginDeleteAtManagementGroupAsync(String mana * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, - String deploymentStackName); + SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -1029,17 +950,16 @@ SyncPoller, Void> beginDeleteAtManagementGroup(String managemen * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -1052,16 +972,14 @@ SyncPoller, Void> beginDeleteAtManagementGroup(String managemen * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, + Mono deleteAtSubscriptionAsync(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1069,26 +987,24 @@ Mono deleteAtManagementGroupAsync(String managementGroupId, String deploym * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName); + Mono deleteAtSubscriptionAsync(String deploymentStackName); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroup(String managementGroupId, String deploymentStackName); + void deleteAtSubscription(String deploymentStackName); /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -1101,16 +1017,14 @@ Mono deleteAtManagementGroupAsync(String managementGroupId, String deploym * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroup(String managementGroupId, String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, + void deleteAtSubscription(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context); /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1120,12 +1034,11 @@ void deleteAtManagementGroup(String managementGroupId, String deploymentStackNam */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> - exportTemplateAtResourceGroupWithResponseAsync(String resourceGroupName, String deploymentStackName); + exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1133,13 +1046,11 @@ void deleteAtManagementGroup(String managementGroupId, String deploymentStackNam * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtResourceGroupAsync(String resourceGroupName, - String deploymentStackName); + Mono exportTemplateAtSubscriptionAsync(String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1148,13 +1059,12 @@ Mono exportTemplateAtResourceGroupAsync( * @return export Template specific properties of the Deployment stack along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtResourceGroupWithResponse(String resourceGroupName, - String deploymentStackName, Context context); + Response + exportTemplateAtSubscriptionWithResponse(String deploymentStackName, Context context); /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1162,126 +1072,108 @@ Response exportTemplateAtResourceGroupWi * @return export Template specific properties of the Deployment stack. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(String resourceGroupName, - String deploymentStackName); + DeploymentStackTemplateDefinitionInner exportTemplateAtSubscription(String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack along with {@link Response} on successful - * completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> - exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName); + Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtSubscriptionAsync(String deploymentStackName); + Mono getAtManagementGroupAsync(String managementGroupId, String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @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 export Template specific properties of the Deployment stack along with {@link Response}. + * @return the Deployment stack with the given name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response - exportTemplateAtSubscriptionWithResponse(String deploymentStackName, Context context); + Response getAtManagementGroupWithResponse(String managementGroupId, + String deploymentStackName, Context context); /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack. + * @return the Deployment stack with the given name. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackTemplateDefinitionInner exportTemplateAtSubscription(String deploymentStackName); + DeploymentStackInner getAtManagementGroup(String managementGroupId, String deploymentStackName); /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> - exportTemplateAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtManagementGroupAsync(String managementGroupId); /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtManagementGroupAsync(String managementGroupId, - String deploymentStackName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroup(String managementGroupId); /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack along with {@link Response}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtManagementGroupWithResponse( - String managementGroupId, String deploymentStackName, Context context); - - /** - * Exports the template used to create the Deployment stack at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(String managementGroupId, - String deploymentStackName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroup(String managementGroupId, Context context); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1289,16 +1181,16 @@ DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(String ma * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1306,16 +1198,16 @@ Mono>> validateStackAtResourceGroupWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1323,16 +1215,16 @@ Mono>> validateStackAtResourceGroupWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @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. @@ -1341,48 +1233,48 @@ Mono>> validateStackAtResourceGroupWithResponseAsync(S */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateStackAtResourceGroupAsync(String resourceGroupName, + Mono validateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @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. @@ -1390,233 +1282,341 @@ DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceG * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack); + Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Deployment stack validation result. + * @return the {@link PollerFlux} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack); + PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtManagementGroupAsync( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Deployment stack validation result. + * @return the {@link SyncPoller} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack); + SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @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 Deployment stack validation result. + * @return the {@link SyncPoller} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, - Context context); + SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. + * @return deployment stack object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateStackAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack); + Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. + * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack); /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @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 Deployment stack validation result. + * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack); + Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Deployment stack validation result. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack); + PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 Deployment stack validation result. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack); + PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, + String deploymentStackName); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, + String deploymentStackName); + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @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 Deployment stack validation result. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context); + SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateStackAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack); + Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack); + Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName); /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtManagementGroup(String managementGroupId, String deploymentStackName); + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtManagementGroup(String managementGroupId, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context); + + /** + * Exports the template used to create the Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> + exportTemplateAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName); + + /** + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono exportTemplateAtManagementGroupAsync(String managementGroupId, + String deploymentStackName); + + /** + * Exports the template used to create the Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @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 Deployment stack validation result. + * @return export Template specific properties of the Deployment stack along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context); + Response exportTemplateAtManagementGroupWithResponse( + String managementGroupId, String deploymentStackName, Context context); + + /** + * Exports the template used to create the Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return export Template specific properties of the Deployment stack. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(String managementGroupId, + String deploymentStackName); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksManagementClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksManagementClient.java index 03fd1a888d08..866906234d65 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksManagementClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -12,26 +12,26 @@ */ public interface DeploymentStacksManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java index baf51bda5607..4aa1e2cc2551 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -35,149 +35,62 @@ public interface DeploymentsClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context); + Mono> getAtScopeWithResponseAsync(String scope, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtScopeAsync(String scope, String deploymentName); + Mono getAtScopeAsync(String scope, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope, String deploymentName); + Response getAtScopeWithResponse(String scope, String deploymentName, Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope, String deploymentName, Context context); + DeploymentExtendedInner getAtScope(String scope, String deploymentName); /** * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -190,7 +103,7 @@ public interface DeploymentsClient extends InnerSupportsGet>> createOrUpdateAtScopeWithResponseAsync(String s * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,7 +179,7 @@ Mono>> createOrUpdateAtScopeWithResponseAsync(String s * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -283,7 +196,7 @@ SyncPoller, DeploymentExtendedInner> beginCr * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -301,7 +214,7 @@ SyncPoller, DeploymentExtendedInner> beginCr * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -318,7 +231,7 @@ Mono createOrUpdateAtScopeAsync(String scope, String de * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -334,7 +247,7 @@ Mono createOrUpdateAtScopeAsync(String scope, String de * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -348,482 +261,485 @@ DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentNam Context context); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. * - * @param scope The resource scope. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtScopeWithResponseAsync(String scope, String deploymentName); + Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtScopeAsync(String scope, String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtScopeWithResponse(String scope, String deploymentName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtScope(String scope, String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context); /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName); + Mono deleteAtScopeAsync(String scope, String deploymentName); /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAtScopeAsync(String scope, String deploymentName); + void deleteAtScope(String scope, String deploymentName); /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context); + void deleteAtScope(String scope, String deploymentName, Context context); /** - * Cancels a currently running template deployment. - * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments at the given scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void cancelAtScope(String scope, String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtScopeAsync(String scope, String filter, Integer top); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response along with {@link Response} on successful - * completion of {@link Mono}. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, - DeploymentInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtScopeAsync(String scope); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of information from validate template deployment response. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentValidateResultInner> - beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope(String scope); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @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 information from validate template deployment response. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope(String scope, String filter, Integer top, Context context); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. * - * @param scope The resource scope. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @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 information from validate template deployment response. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentValidateResultInner> - beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. * - * @param scope The resource scope. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAtScopeAsync(String scope, String deploymentName, - DeploymentInner parameters); + Mono cancelAtScopeAsync(String scope, String deploymentName); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. * - * @param scope The resource scope. + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, DeploymentInner parameters); + Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context); /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, DeploymentInner parameters, - Context context); + void cancelAtScope(String scope, String deploymentName); /** - * Exports the template used for specified deployment. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> exportTemplateAtScopeWithResponseAsync(String scope, - String deploymentName); + Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, + DeploymentInner parameters); /** - * Exports the template used for specified deployment. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono exportTemplateAtScopeAsync(String scope, String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, DeploymentValidateResultInner> + beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters); /** - * Exports the template used for specified deployment. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response}. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportTemplateAtScopeWithResponse(String scope, String deploymentName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters); /** - * Exports the template used for specified deployment. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @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 deployment export result. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context); /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments at the given scope as paginated response with {@link PagedFlux}. + * @return information from validate template deployment response on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope, String filter, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono validateAtScopeAsync(String scope, String deploymentName, + DeploymentInner parameters); /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments at the given scope as paginated response with {@link PagedFlux}. + * @return information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtScopeAsync(String scope); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, DeploymentInner parameters); /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @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 deployments at the given scope as paginated response with {@link PagedIterable}. + * @return information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope(String scope); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, DeploymentInner parameters, + Context context); /** - * Get all the deployments at the given scope. + * Exports the template used for specified deployment. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments at the given scope as paginated response with {@link PagedIterable}. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtScope(String scope, String filter, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> exportTemplateAtScopeWithResponseAsync(String scope, + String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the deployment export result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName); + Mono exportTemplateAtScopeAsync(String scope, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @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 PollerFlux} for polling of long-running operation. + * @return the deployment export result along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtScopeWithResponse(String scope, String deploymentName, + Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the deployment export result. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getAtTenantScopeWithResponseAsync(String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtTenantScopeAsync(String deploymentName); + Mono getAtTenantScopeAsync(String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtTenantScope(String deploymentName); + Response getAtTenantScopeWithResponse(String deploymentName, Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtTenantScope(String deploymentName, Context context); + DeploymentExtendedInner getAtTenantScope(String deploymentName); /** * Checks whether the deployment exists. @@ -987,53 +903,137 @@ DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, Scope Context context); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtTenantScopeWithResponseAsync(String deploymentName); + Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtTenantScopeAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtTenantScopeWithResponse(String deploymentName, Context context); + Mono deleteAtTenantScopeAsync(String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtTenantScope(String deploymentName); + void deleteAtTenantScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtTenantScope(String deploymentName, Context context); /** * Cancels a currently running template deployment. @@ -1369,180 +1369,93 @@ Response exportTemplateAtTenantScopeWithResponse(St /** * Get all the deployments at the tenant scope. - * - * @throws com.azure.core.management.exception.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 deployments at the tenant scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(); - - /** - * Get all the deployments at the tenant scope. - * - * @throws com.azure.core.management.exception.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 deployments at the tenant scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(); - - /** - * Get all the deployments at the tenant scope. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @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 deployments at the tenant scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(String filter, Integer top, Context context); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return all the deployments at the tenant scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, - String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtTenantScopeAsync(); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Get all the deployments at the tenant scope. * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Get all the deployments at the tenant scope. * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String filter, Integer top, Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, + String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName); + Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroupScope(String groupId, String deploymentName); + Response getAtManagementGroupScopeWithResponse(String groupId, String deploymentName, + Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context); + DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName); /** * Checks whether the deployment exists. @@ -1722,59 +1635,202 @@ DeploymentExtendedInner createOrUpdateAtManagementGroupScope(String groupId, Str ScopedDeployment parameters, Context context); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, + Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName, + Context context); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName); + Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, Integer top); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group 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 all the deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtManagementGroupScopeAsync(String groupId); /** - * Gets a deployment. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupScopeWithResponse(String groupId, String deploymentName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope(String groupId); /** - * Gets a deployment. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope(String groupId, String filter, Integer top, + Context context); /** * Cancels a currently running template deployment. @@ -2124,404 +2180,397 @@ Response exportTemplateAtManagementGroupScopeWithRe DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName); /** - * Get all the deployments for a management group. + * Gets a deployment. * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments for a management group as paginated response with {@link PagedFlux}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName); /** - * Get all the deployments for a management group. + * Gets a deployment. * - * @param groupId The management group ID. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments for a management group as paginated response with {@link PagedFlux}. + * @return a deployment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtManagementGroupScopeAsync(String groupId); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAtSubscriptionScopeAsync(String deploymentName); /** - * Get all the deployments for a management group. + * Gets a deployment. * - * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @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 deployments for a management group as paginated response with {@link PagedIterable}. + * @return a deployment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope(String groupId); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context); /** - * Get all the deployments for a management group. + * Gets a deployment. * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 deployments for a management group as paginated response with {@link PagedIterable}. + * @return a deployment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtManagementGroupScope(String groupId, String filter, Integer top, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getAtSubscriptionScope(String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName); + Mono> checkExistenceAtSubscriptionScopeWithResponseAsync(String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return whether resource exists on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono checkExistenceAtSubscriptionScopeAsync(String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return whether resource exists along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return whether resource exists. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceAtSubscriptionScope(String deploymentName); /** - * Deletes a deployment from the deployment history. + * Deploys resources at subscription scope. * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtSubscriptionScopeAsync(String deploymentName); + Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, + DeploymentInner parameters); /** - * Deletes a deployment from the deployment history. + * Deploys resources at subscription scope. * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the 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 PollerFlux} for polling of deployment information. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscriptionScope(String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters); /** - * Deletes a deployment from the deployment history. + * Deploys resources at subscription scope. * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. + * @param parameters Additional parameters supplied to the 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 deployment information. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtSubscriptionScope(String deploymentName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); /** - * Checks whether the deployment exists. + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of deployment information. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceAtSubscriptionScopeWithResponseAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context); /** - * Checks whether the deployment exists. + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the 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 whether resource exists on successful completion of {@link Mono}. + * @return deployment information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAtSubscriptionScopeAsync(String deploymentName); + Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, + DeploymentInner parameters); /** - * Checks whether the deployment exists. + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. + * @param parameters Additional parameters supplied to the 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 whether resource exists along with {@link Response}. + * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context); + DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); /** - * Checks whether the deployment exists. + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. * * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @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 whether resource exists. + * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceAtSubscriptionScope(String deploymentName); + DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, + Context context); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the 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 deployment information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, - DeploymentInner parameters); + Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the 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 PollerFlux} for polling of deployment information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters); + PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the 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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); + SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context); + SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the 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 deployment information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, - DeploymentInner parameters); + Mono deleteAtSubscriptionScopeAsync(String deploymentName); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the 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 deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters); + void deleteAtSubscriptionScope(String deploymentName); /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @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 deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, - Context context); + void deleteAtSubscriptionScope(String deploymentName, Context context); /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter, Integer top); /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtSubscriptionScopeAsync(String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getAtSubscriptionScope(String deploymentName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); /** * Cancels a currently running template deployment. @@ -2844,213 +2893,64 @@ Response exportTemplateAtSubscriptionScopeWithRespo DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName); /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 deployments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, Integer top); - - /** - * Get all the deployments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Get all the deployments for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @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 deployments for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Integer top, Context context); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName); - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. - * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, Context context); + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String deploymentName); + Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String deploymentName); + Response getByResourceGroupWithResponse(String resourceGroupName, String deploymentName, + Context context); /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String deploymentName, Context context); + DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName); /** * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3063,8 +2963,7 @@ Response exportTemplateAtSubscriptionScopeWithRespo /** * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3077,8 +2976,7 @@ Response exportTemplateAtSubscriptionScopeWithRespo /** * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3092,8 +2990,7 @@ Response exportTemplateAtSubscriptionScopeWithRespo /** * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3108,8 +3005,7 @@ Response exportTemplateAtSubscriptionScopeWithRespo * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3126,8 +3022,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3144,8 +3039,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3162,8 +3056,7 @@ Mono>> createOrUpdateWithResponseAsync(String resource * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -3181,8 +3074,7 @@ SyncPoller, DeploymentExtendedInner> beginCr * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3199,8 +3091,7 @@ Mono createOrUpdateAsync(String resourceGroupName, Stri * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3216,8 +3107,7 @@ Mono createOrUpdateAsync(String resourceGroupName, Stri * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -3231,59 +3121,207 @@ DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deployme Context context); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentName); + Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String deploymentName, - Context context); + Mono deleteAsync(String resourceGroupName, String deploymentName); /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName); + void delete(String resourceGroupName, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, Context context); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer top); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @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 deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer top, + Context context); /** * Cancels a currently running template deployment. @@ -3292,7 +3330,7 @@ Response getByResourceGroupWithResponse(String resource * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3309,7 +3347,7 @@ Response getByResourceGroupWithResponse(String resource * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3326,7 +3364,7 @@ Response getByResourceGroupWithResponse(String resource * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3344,7 +3382,7 @@ Response getByResourceGroupWithResponse(String resource * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3357,8 +3395,7 @@ Response getByResourceGroupWithResponse(String resource * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3375,8 +3412,7 @@ Mono>> validateWithResponseAsync(String resourceGroupN * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3392,8 +3428,7 @@ Mono>> validateWithResponseAsync(String resourceGroupN * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3409,8 +3444,7 @@ Mono>> validateWithResponseAsync(String resourceGroupN * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -3427,8 +3461,7 @@ Mono>> validateWithResponseAsync(String resourceGroupN * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3444,8 +3477,7 @@ Mono validateAsync(String resourceGroupName, Stri * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3460,8 +3492,7 @@ Mono validateAsync(String resourceGroupName, Stri * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -3477,8 +3508,7 @@ DeploymentValidateResultInner validate(String resourceGroupName, String deployme /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3493,8 +3523,7 @@ Mono>> whatIfWithResponseAsync(String resourceGroupNam /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3509,8 +3538,7 @@ Mono>> whatIfWithResponseAsync(String resourceGroupNam /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3525,8 +3553,7 @@ SyncPoller, WhatIfOperationResultInner> b /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -3542,8 +3569,7 @@ SyncPoller, WhatIfOperationResultInner> b /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3558,8 +3584,7 @@ Mono whatIfAsync(String resourceGroupName, String de /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3573,8 +3598,7 @@ Mono whatIfAsync(String resourceGroupName, String de /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -3590,7 +3614,7 @@ WhatIfOperationResultInner whatIf(String resourceGroupName, String deploymentNam /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3604,7 +3628,7 @@ Mono> exportTemplateWithResponseAsync(Stri /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3617,7 +3641,7 @@ Mono> exportTemplateWithResponseAsync(Stri /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -3632,7 +3656,7 @@ Response exportTemplateWithResponse(String resource /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3642,70 +3666,10 @@ Response exportTemplateWithResponse(String resource @ServiceMethod(returns = ReturnType.SINGLE) DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName); - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 deployments for a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer top); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @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 deployments for a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer top, - Context context); - /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3718,7 +3682,7 @@ PagedIterable listByResourceGroup(String resourceGroupN /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3730,7 +3694,7 @@ PagedIterable listByResourceGroup(String resourceGroupN /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -3743,7 +3707,7 @@ PagedIterable listByResourceGroup(String resourceGroupN /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsManagementClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsManagementClient.java index 1d421f8c1b1b..d718f94a269b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsManagementClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -12,26 +12,26 @@ */ public interface DeploymentsManagementClient { /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java index 4e35f28981cf..5ba6f1a8c64a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeatureClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java index 04d3ce99000f..14e636c9819f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/FeaturesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java index c4bc44c0d157..ba0f5916582e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLockClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java index 980b7d8a4846..92ccc3096c07 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ManagementLocksClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java index 2a61a523a248..528994147693 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -16,35 +16,35 @@ */ public interface OperationsClient { /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java index b3152b3a9a81..c1fb18d57b28 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -22,60 +22,57 @@ public interface PolicyAssignmentsClient extends InnerSupportsListing, InnerSupportsDelete { /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String scope, String policyAssignmentName); + Mono> getByIdWithResponseAsync(String policyAssignmentId); /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String scope, String policyAssignmentName); + Mono getByIdAsync(String policyAssignmentId); /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @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. @@ -83,89 +80,90 @@ public interface PolicyAssignmentsClient * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String policyAssignmentName, Context context); + Response getByIdWithResponse(String policyAssignmentId, Context context); /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner delete(String scope, String policyAssignmentName); + PolicyAssignmentInner getById(String policyAssignmentId); /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync(String scope, String policyAssignmentName, + Mono> createByIdWithResponseAsync(String policyAssignmentId, PolicyAssignmentInner parameters); /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync(String scope, String policyAssignmentName, - PolicyAssignmentInner parameters); + Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters); /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @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. @@ -173,85 +171,94 @@ Mono createAsync(String scope, String policyAssignmentNam * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String scope, String policyAssignmentName, - PolicyAssignmentInner parameters, Context context); + Response createByIdWithResponse(String policyAssignmentId, PolicyAssignmentInner parameters, + Context context); /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters); + PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters); /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String scope, String policyAssignmentName, - String expand); + Mono> updateByIdWithResponseAsync(String policyAssignmentId, + PolicyAssignmentUpdate parameters); /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String scope, String policyAssignmentName); + Mono updateByIdAsync(String policyAssignmentId, PolicyAssignmentUpdate parameters); /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @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. @@ -259,88 +266,286 @@ Mono> getWithResponseAsync(String scope, String * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String policyAssignmentName, String expand, + Response updateByIdWithResponse(String policyAssignmentId, PolicyAssignmentUpdate parameters, Context context); /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner get(String scope, String policyAssignmentName); + PolicyAssignmentInner updateById(String policyAssignmentId, PolicyAssignmentUpdate parameters); /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters); + Mono> deleteByIdWithResponseAsync(String policyAssignmentId); /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters); + Mono deleteByIdAsync(String policyAssignmentId); /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @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 policy assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteByIdWithResponse(String policyAssignmentId, Context context); + + /** + * Deletes a policy assignment. + * + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyAssignmentInner deleteById(String policyAssignmentId); + + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String scope, String policyAssignmentName, + String expand); + + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String scope, String policyAssignmentName); + + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @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 policy assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, String policyAssignmentName, String expand, + Context context); + + /** + * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyAssignmentInner get(String scope, String policyAssignmentName); + + /** + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters); + + /** + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters); + + /** + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. + * @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 policy assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters, Context context); + + /** + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters); + + /** + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters); + + /** + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters); + + /** + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. * @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. @@ -352,18 +557,12 @@ Response updateWithResponse(String scope, String policyAs PolicyAssignmentUpdate parameters, Context context); /** - * Updates a policy assignment. - * * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all * resources contained within their scope. For example, when you assign a policy at resource group scope, that * policy applies to all resources in the group. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -374,8 +573,67 @@ Response updateWithResponse(String scope, String policyAs PolicyAssignmentInner update(String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters); /** - * Retrieves all policy assignments that apply to a resource group. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String scope, String policyAssignmentName); + + /** + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String scope, String policyAssignmentName); + + /** + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @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 policy assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String scope, String policyAssignmentName, Context context); + + /** + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyAssignmentInner delete(String scope, String policyAssignmentName); + + /** * This operation retrieves the list of all policy assignments associated with the given resource group in the given * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy @@ -387,7 +645,7 @@ Response updateWithResponse(String scope, String policyAs * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments * of the policy definition whose id is {value} that apply to the resource group. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -401,15 +659,13 @@ Response updateWithResponse(String scope, String policyAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, String expand, Integer top); /** - * Retrieves all policy assignments that apply to a resource group. - * * This operation retrieves the list of all policy assignments associated with the given resource group in the given * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy @@ -421,18 +677,16 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments * of the policy definition whose id is {value} that apply to the resource group. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Retrieves all policy assignments that apply to a resource group. - * * This operation retrieves the list of all policy assignments associated with the given resource group in the given * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy @@ -444,18 +698,16 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments * of the policy definition whose id is {value} that apply to the resource group. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** - * Retrieves all policy assignments that apply to a resource group. - * * This operation retrieves the list of all policy assignments associated with the given resource group in the given * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy @@ -467,7 +719,7 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments * of the policy definition whose id is {value} that apply to the resource group. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -482,192 +734,14 @@ PagedFlux listByResourceGroupAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, String filter, String expand, Integer top, Context context); /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String filter, String expand, Integer top); - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName); - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName); - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @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 policy assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String filter, String expand, Integer top, - Context context); - - /** - * Retrieves all policy assignments that apply to a management group. + * Retrieves all policy assignments that apply to a management group. * * This operation retrieves the list of all policy assignments applicable to the management group that match the * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. @@ -677,7 +751,7 @@ PagedIterable listForResource(String resourceGroupName, S * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that * apply to the management group. * - * @param managementGroupId The ID of the management group. + * @param managementGroupId The management group ID. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -691,7 +765,7 @@ PagedIterable listForResource(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForManagementGroupAsync(String managementGroupId, String filter, String expand, @@ -708,11 +782,11 @@ PagedFlux listForManagementGroupAsync(String managementGr * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that * apply to the management group. * - * @param managementGroupId The ID of the management group. + * @param managementGroupId The management group 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 list of policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForManagementGroupAsync(String managementGroupId); @@ -728,11 +802,11 @@ PagedFlux listForManagementGroupAsync(String managementGr * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that * apply to the management group. * - * @param managementGroupId The ID of the management group. + * @param managementGroupId The management group 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 list of policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForManagementGroup(String managementGroupId); @@ -748,7 +822,7 @@ PagedFlux listForManagementGroupAsync(String managementGr * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that * apply to the management group. * - * @param managementGroupId The ID of the management group. + * @param managementGroupId The management group ID. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -763,7 +837,7 @@ PagedFlux listForManagementGroupAsync(String managementGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForManagementGroup(String managementGroupId, String filter, String expand, @@ -796,7 +870,7 @@ PagedIterable listForManagementGroup(String managementGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String filter, String expand, Integer top); @@ -817,7 +891,7 @@ PagedIterable listForManagementGroup(String managementGro * * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); @@ -838,7 +912,7 @@ PagedIterable listForManagementGroup(String managementGro * * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -871,364 +945,186 @@ PagedIterable listForManagementGroup(String managementGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, String expand, Integer top, Context context); /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteByIdWithResponseAsync(String policyAssignmentId); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String filter, String expand, Integer top); /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByIdAsync(String policyAssignmentId); - - /** - * Deletes a policy assignment. - * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @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 policy assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteByIdWithResponse(String policyAssignmentId, Context context); - - /** - * Deletes a policy assignment. - * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). - * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner deleteById(String policyAssignmentId); - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentInner parameters); - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters); - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @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 policy assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createByIdWithResponse(String policyAssignmentId, PolicyAssignmentInner parameters, - Context context); - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters); - - /** - * Retrieves the policy assignment with the given ID. - * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String policyAssignmentId); - - /** - * Retrieves the policy assignment with the given ID. - * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String policyAssignmentId); - - /** - * Retrieves the policy assignment with the given ID. - * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @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 policy assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String policyAssignmentId, Context context); - - /** - * Retrieves the policy assignment with the given ID. - * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner getById(String policyAssignmentId); - - /** - * Updates a policy assignment. - * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentUpdate parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByIdAsync(String policyAssignmentId, PolicyAssignmentUpdate parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @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 policy assignment along with {@link Response}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateByIdWithResponse(String policyAssignmentId, PolicyAssignmentUpdate parameters, + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String filter, String expand, Integer top, Context context); - - /** - * Updates a policy assignment. - * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyAssignmentInner updateById(String policyAssignmentId, PolicyAssignmentUpdate parameters); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java index 33fa1a339aab..e02cc0353d7d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; import com.azure.core.http.HttpPipeline; @@ -11,86 +10,94 @@ * The interface for PolicyClient class. */ public interface PolicyClient { - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); /** - * Gets server parameter. - * + * Gets Service host. + * * @return the endpoint value. */ String getEndpoint(); + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); - /** - * Gets the DataPolicyManifestsClient object to access its operations. - * - * @return the DataPolicyManifestsClient object. - */ - DataPolicyManifestsClient getDataPolicyManifests(); - /** * Gets the PolicyAssignmentsClient object to access its operations. - * + * * @return the PolicyAssignmentsClient object. */ PolicyAssignmentsClient getPolicyAssignments(); + /** + * Gets the DataPolicyManifestsClient object to access its operations. + * + * @return the DataPolicyManifestsClient object. + */ + DataPolicyManifestsClient getDataPolicyManifests(); + /** * Gets the PolicyDefinitionsClient object to access its operations. - * + * * @return the PolicyDefinitionsClient object. */ PolicyDefinitionsClient getPolicyDefinitions(); /** * Gets the PolicyDefinitionVersionsClient object to access its operations. - * + * * @return the PolicyDefinitionVersionsClient object. */ PolicyDefinitionVersionsClient getPolicyDefinitionVersions(); /** * Gets the PolicySetDefinitionsClient object to access its operations. - * + * * @return the PolicySetDefinitionsClient object. */ PolicySetDefinitionsClient getPolicySetDefinitions(); /** * Gets the PolicySetDefinitionVersionsClient object to access its operations. - * + * * @return the PolicySetDefinitionVersionsClient object. */ PolicySetDefinitionVersionsClient getPolicySetDefinitionVersions(); /** * Gets the PolicyTokensClient object to access its operations. - * + * * @return the PolicyTokensClient object. */ PolicyTokensClient getPolicyTokens(); /** * Gets the PolicyExemptionsClient object to access its operations. - * + * * @return the PolicyExemptionsClient object. */ PolicyExemptionsClient getPolicyExemptions(); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionVersionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionVersionsClient.java index 45b00ad3a86b..64f8e7e7f2fa 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionVersionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionVersionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -20,167 +20,66 @@ */ public interface PolicyDefinitionVersionsClient extends InnerSupportsDelete { /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws com.azure.core.management.exception.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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAllBuiltinsWithResponseAsync(); - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws com.azure.core.management.exception.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 policy definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllBuiltinsAsync(); - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @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 policy definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllBuiltinsWithResponse(Context context); - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws com.azure.core.management.exception.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 policy definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionListResultInner listAllBuiltins(); - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. + * This operation retrieves the policy definition version in the given subscription with the given name. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. + * @return the ID of the policy definition version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName); + Mono> getWithResponseAsync(String policyDefinitionName, + String policyDefinitionVersion); /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. + * This operation retrieves the policy definition version in the given subscription with the given name. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions on successful completion of {@link Mono}. + * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllAtManagementGroupAsync(String managementGroupName); + Mono getAsync(String policyDefinitionName, String policyDefinitionVersion); /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. + * This operation retrieves the policy definition version in the given subscription with the given name. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @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 policy definition versions along with {@link Response}. + * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllAtManagementGroupWithResponse(String managementGroupName, + Response getWithResponse(String policyDefinitionName, String policyDefinitionVersion, Context context); /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName); - - /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAllWithResponseAsync(); - - /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllAsync(); - - /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. + * This operation retrieves the policy definition version in the given subscription with the given name. * - * @param context The context to associate with this operation. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllWithResponse(Context context); - - /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions. + * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionListResultInner listAll(); + PolicyDefinitionVersionInner get(String policyDefinitionName, String policyDefinitionVersion); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -198,8 +97,6 @@ Mono> createOrUpdateWithResponseAsync(Str String policyDefinitionVersion, PolicyDefinitionVersionInner parameters); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -216,8 +113,6 @@ Mono createOrUpdateAsync(String policyDefinitionNa PolicyDefinitionVersionInner parameters); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -235,8 +130,6 @@ Response createOrUpdateWithResponse(String policyD String policyDefinitionVersion, PolicyDefinitionVersionInner parameters, Context context); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -253,8 +146,6 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String PolicyDefinitionVersionInner parameters); /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -269,8 +160,6 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String Mono> deleteWithResponseAsync(String policyDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -285,8 +174,6 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String Mono deleteAsync(String policyDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -302,8 +189,6 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String Response deleteWithResponse(String policyDefinitionName, String policyDefinitionVersion, Context context); /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -317,9 +202,60 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String void delete(String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a policy definition version in a subscription. + * This operation retrieves a list of all the policy definition versions for the given policy definition. * - * This operation retrieves the policy definition version in the given subscription with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String policyDefinitionName, Integer top); + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String policyDefinitionName); + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String policyDefinitionName); + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String policyDefinitionName, Integer top, Context context); + + /** + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -331,13 +267,11 @@ PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String policyDefinitionName, + Mono> getBuiltInWithResponseAsync(String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -348,12 +282,10 @@ Mono> getWithResponseAsync(String policyD * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String policyDefinitionName, String policyDefinitionVersion); + Mono getBuiltInAsync(String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -365,13 +297,11 @@ Mono> getWithResponseAsync(String policyD * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String policyDefinitionName, String policyDefinitionVersion, - Context context); + Response getBuiltInWithResponse(String policyDefinitionName, + String policyDefinitionVersion, Context context); /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -382,14 +312,66 @@ Response getWithResponse(String policyDefinitionNa * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionInner get(String policyDefinitionName, String policyDefinitionVersion); + PolicyDefinitionVersionInner getBuiltIn(String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a built-in policy definition version. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * - * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top); + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBuiltInAsync(String policyDefinitionName); + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuiltIn(String policyDefinitionName); + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuiltIn(String policyDefinitionName, Integer top, Context context); + + /** + * This operation retrieves the policy definition version in the given management group with the given name. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -399,14 +381,13 @@ Response getWithResponse(String policyDefinitionNa * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuiltInWithResponseAsync(String policyDefinitionName, - String policyDefinitionVersion); + Mono> getAtManagementGroupWithResponseAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. @@ -416,13 +397,13 @@ Mono> getBuiltInWithResponseAsync(String * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuiltInAsync(String policyDefinitionName, String policyDefinitionVersion); + Mono getAtManagementGroupAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion); /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. @@ -433,14 +414,13 @@ Mono> getBuiltInWithResponseAsync(String * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuiltInWithResponse(String policyDefinitionName, - String policyDefinitionVersion, Context context); + Response getAtManagementGroupWithResponse(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion, Context context); /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. @@ -450,11 +430,10 @@ Response getBuiltInWithResponse(String policyDefin * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionInner getBuiltIn(String policyDefinitionName, String policyDefinitionVersion); + PolicyDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policyDefinitionName, + String policyDefinitionVersion); /** - * Creates or updates a policy definition version in a management group. - * * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -474,8 +453,6 @@ Mono> createOrUpdateAtManagementGroupWith PolicyDefinitionVersionInner parameters); /** - * Creates or updates a policy definition version in a management group. - * * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -493,8 +470,6 @@ Mono createOrUpdateAtManagementGroupAsync(String m String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters); /** - * Creates or updates a policy definition version in a management group. - * * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -514,8 +489,6 @@ Response createOrUpdateAtManagementGroupWithRespon Context context); /** - * Creates or updates a policy definition version in a management group. - * * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -533,8 +506,6 @@ PolicyDefinitionVersionInner createOrUpdateAtManagementGroup(String managementGr String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters); /** - * Deletes a policy definition in a management group. - * * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -551,8 +522,6 @@ Mono> deleteAtManagementGroupWithResponseAsync(String managementG String policyDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy definition in a management group. - * * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -569,8 +538,6 @@ Mono deleteAtManagementGroupAsync(String managementGroupName, String polic String policyDefinitionVersion); /** - * Deletes a policy definition in a management group. - * * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -588,8 +555,6 @@ Response deleteAtManagementGroupWithResponse(String managementGroupName, S String policyDefinitionVersion, Context context); /** - * Deletes a policy definition in a management group. - * * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. @@ -605,265 +570,229 @@ void deleteAtManagementGroup(String managementGroupName, String policyDefinition String policyDefinitionVersion); /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByManagementGroupAsync(String managementGroupName, + String policyDefinitionName, Integer top); /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version on successful completion of {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByManagementGroupAsync(String managementGroupName, + String policyDefinitionName); /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. - * @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 ID of the policy definition version along with {@link Response}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagementGroup(String managementGroupName, + String policyDefinitionName); /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @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 ID of the policy definition version. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policyDefinitionName, - String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagementGroup(String managementGroupName, + String policyDefinitionName, Integer top, Context context); /** - * Retrieves policy definition versions for a given policy definition in a subscription + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String policyDefinitionName, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listAllBuiltinsWithResponseAsync(); /** - * Retrieves policy definition versions for a given policy definition in a subscription + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllBuiltinsAsync(); /** - * Retrieves policy definition versions for a given policy definition in a subscription + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. + * @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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllBuiltinsWithResponse(Context context); /** - * Retrieves policy definition versions for a given policy definition in a subscription + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String policyDefinitionName, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyDefinitionVersionListResultInner listAllBuiltins(); /** - * Retrieve built-in policy definition versions + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupName The name of the management group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName); /** - * Retrieve built-in policy definition versions + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * - * @param policyDefinitionName The name of the policy definition. + * @param managementGroupName The name of the management group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllAtManagementGroupAsync(String managementGroupName); /** - * Retrieve built-in policy definition versions + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * - * @param policyDefinitionName The name of the policy definition. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllAtManagementGroupWithResponse(String managementGroupName, + Context context); /** - * Retrieve built-in policy definition versions + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupName The name of the management group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(String policyDefinitionName, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName); /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByManagementGroupAsync(String managementGroupName, - String policyDefinitionName, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listAllWithResponseAsync(); /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByManagementGroupAsync(String managementGroupName, - String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllAsync(); /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. + * @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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupName, - String policyDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllWithResponse(Context context); /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupName, - String policyDefinitionName, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyDefinitionVersionListResultInner listAll(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java index f68631cc6382..de99fa39d723 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -18,11 +18,58 @@ */ public interface PolicyDefinitionsClient { /** - * Creates or updates a policy definition in a subscription. + * This operation retrieves the policy definition in the given subscription with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String policyDefinitionName); + + /** + * This operation retrieves the policy definition in the given subscription with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String policyDefinitionName); + + /** + * This operation retrieves the policy definition in the given subscription with the given name. * + * @param policyDefinitionName The name of the policy definition to get. + * @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 policy definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String policyDefinitionName, Context context); + + /** + * This operation retrieves the policy definition in the given subscription with the given name. + * + * @param policyDefinitionName The name of the policy definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicyDefinitionInner get(String policyDefinitionName); + + /** * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. + * @param policyDefinitionName The name of the policy definition to get. * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -34,11 +81,9 @@ Mono> createOrUpdateWithResponseAsync(String pol PolicyDefinitionInner parameters); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. + * @param policyDefinitionName The name of the policy definition to get. * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,11 +94,9 @@ Mono> createOrUpdateWithResponseAsync(String pol Mono createOrUpdateAsync(String policyDefinitionName, PolicyDefinitionInner parameters); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. + * @param policyDefinitionName The name of the policy definition to get. * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -66,11 +109,9 @@ Response createOrUpdateWithResponse(String policyDefiniti PolicyDefinitionInner parameters, Context context); /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. + * @param policyDefinitionName The name of the policy definition to get. * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -81,11 +122,9 @@ Response createOrUpdateWithResponse(String policyDefiniti PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters); /** - * Deletes a policy definition in a subscription. - * * This operation deletes the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -95,11 +134,9 @@ Response createOrUpdateWithResponse(String policyDefiniti Mono> deleteWithResponseAsync(String policyDefinitionName); /** - * Deletes a policy definition in a subscription. - * * This operation deletes the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -109,11 +146,9 @@ Response createOrUpdateWithResponse(String policyDefiniti Mono deleteAsync(String policyDefinitionName); /** - * Deletes a policy definition in a subscription. - * * This operation deletes the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @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. @@ -124,11 +159,9 @@ Response createOrUpdateWithResponse(String policyDefiniti Response deleteWithResponse(String policyDefinitionName, Context context); /** - * Deletes a policy definition in a subscription. - * * This operation deletes the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -137,65 +170,97 @@ Response createOrUpdateWithResponse(String policyDefiniti void delete(String policyDefinitionName); /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter, Integer top); /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the policy definition to get. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the policy definition to get. - * @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 policy definition along with {@link Response}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String policyDefinitionName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @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 policy definition. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner get(String policyDefinitionName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); /** - * Retrieves a built-in policy definition. - * * This operation retrieves the built-in policy definition with the given name. * * @param policyDefinitionName The name of the built-in policy definition to get. @@ -208,8 +273,6 @@ Response createOrUpdateWithResponse(String policyDefiniti Mono> getBuiltInWithResponseAsync(String policyDefinitionName); /** - * Retrieves a built-in policy definition. - * * This operation retrieves the built-in policy definition with the given name. * * @param policyDefinitionName The name of the built-in policy definition to get. @@ -222,8 +285,6 @@ Response createOrUpdateWithResponse(String policyDefiniti Mono getBuiltInAsync(String policyDefinitionName); /** - * Retrieves a built-in policy definition. - * * This operation retrieves the built-in policy definition with the given name. * * @param policyDefinitionName The name of the built-in policy definition to get. @@ -237,8 +298,6 @@ Response createOrUpdateWithResponse(String policyDefiniti Response getBuiltInWithResponse(String policyDefinitionName, Context context); /** - * Retrieves a built-in policy definition. - * * This operation retrieves the built-in policy definition with the given name. * * @param policyDefinitionName The name of the built-in policy definition to get. @@ -251,174 +310,171 @@ Response createOrUpdateWithResponse(String policyDefiniti PolicyDefinitionInner getBuiltIn(String policyDefinitionName); /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, - String policyDefinitionName, PolicyDefinitionInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBuiltInAsync(String filter, Integer top); /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String policyDefinitionName, PolicyDefinitionInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBuiltInAsync(); /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. - * @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 policy definition along with {@link Response}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, - String policyDefinitionName, PolicyDefinitionInner parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuiltIn(); /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @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 policy definition. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policyDefinitionName, - PolicyDefinitionInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuiltIn(String filter, Integer top, Context context); /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, String policyDefinitionName); /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the policy definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupAsync(String managementGroupId, String policyDefinitionName); + Mono getAtManagementGroupAsync(String managementGroupId, String policyDefinitionName); /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the policy definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtManagementGroupWithResponse(String managementGroupId, String policyDefinitionName, - Context context); + Response getAtManagementGroupWithResponse(String managementGroupId, + String policyDefinitionName, Context context); /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroup(String managementGroupId, String policyDefinitionName); + PolicyDefinitionInner getAtManagementGroup(String managementGroupId, String policyDefinitionName); /** - * Retrieve a policy definition in a management group. - * - * This operation retrieves the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String policyDefinitionName); + Mono> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, + String policyDefinitionName, PolicyDefinitionInner parameters); /** - * Retrieve a policy definition in a management group. - * - * This operation retrieves the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String managementGroupId, String policyDefinitionName); + Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String policyDefinitionName, PolicyDefinitionInner parameters); /** - * Retrieve a policy definition in a management group. - * - * This operation retrieves the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @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. @@ -426,209 +482,79 @@ Mono> getAtManagementGroupWithResponseAsync(Stri * @return the policy definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse(String managementGroupId, - String policyDefinitionName, Context context); + Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, + String policyDefinitionName, PolicyDefinitionInner parameters, Context context); /** - * Retrieve a policy definition in a management group. - * - * This operation retrieves the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicyDefinitionInner getAtManagementGroup(String managementGroupId, String policyDefinitionName); + PolicyDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policyDefinitionName, + PolicyDefinitionInner parameters); /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, Integer top); - - /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. - * - * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. - * - * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policyDefinitionName); /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAtManagementGroupAsync(String managementGroupId, String policyDefinitionName); /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(String filter, Integer top); - - /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. - * - * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(); - - /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. - * - * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteAtManagementGroupWithResponse(String managementGroupId, String policyDefinitionName, + Context context); /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(String filter, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAtManagementGroup(String managementGroupId, String policyDefinitionName); /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -651,14 +577,12 @@ Response getAtManagementGroupWithResponse(String manageme * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, Integer top); /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -673,14 +597,12 @@ Response getAtManagementGroupWithResponse(String manageme * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByManagementGroupAsync(String managementGroupId); /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -695,14 +617,12 @@ Response getAtManagementGroupWithResponse(String manageme * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByManagementGroup(String managementGroupId); /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -726,7 +646,7 @@ Response getAtManagementGroupWithResponse(String manageme * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByManagementGroup(String managementGroupId, String filter, Integer top, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyExemptionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyExemptionsClient.java index 298281e5ca5b..d45cf20382bb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyExemptionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyExemptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionVersionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionVersionsClient.java index c74909f26061..f3df33766874 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionVersionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionVersionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -20,174 +20,73 @@ */ public interface PolicySetDefinitionVersionsClient extends InnerSupportsDelete { /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. - * - * @throws com.azure.core.management.exception.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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAllBuiltinsWithResponseAsync(); - - /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. - * - * @throws com.azure.core.management.exception.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 policy set definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllBuiltinsAsync(); - - /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. - * - * @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 policy set definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllBuiltinsWithResponse(Context context); - - /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. - * - * @throws com.azure.core.management.exception.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 policy set definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionVersionListResultInner listAllBuiltins(); - - /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName); + Mono> getWithResponseAsync(String policySetDefinitionName, + String policyDefinitionVersion, String expand); /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions on successful completion of {@link Mono}. + * @return the policy set definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllAtManagementGroupAsync(String managementGroupName); + Mono getAsync(String policySetDefinitionName, String policyDefinitionVersion); /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @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 policy set definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllAtManagementGroupWithResponse(String managementGroupName, - Context context); - - /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName); - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listAllWithResponseAsync(); - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions on successful completion of {@link Mono}. + * @return the policy set definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono listAllAsync(); + Response getWithResponse(String policySetDefinitionName, + String policyDefinitionVersion, String expand, Context context); /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * - * @param context The context to associate with this operation. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAllWithResponse(Context context); - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions. + * @return the policy set definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionVersionListResultInner listAll(); + PolicySetDefinitionVersionInner get(String policySetDefinitionName, String policyDefinitionVersion); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -205,8 +104,6 @@ Mono> createOrUpdateWithResponseAsync( String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -224,8 +121,6 @@ Mono createOrUpdateAsync(String policySetDefini String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -244,8 +139,6 @@ Response createOrUpdateWithResponse(String poli String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters, Context context); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -263,8 +156,6 @@ PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinitionName, S PolicySetDefinitionVersionInner parameters); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -280,8 +171,6 @@ PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinitionName, S Mono> deleteWithResponseAsync(String policySetDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -297,8 +186,6 @@ PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinitionName, S Mono deleteAsync(String policySetDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -315,8 +202,6 @@ PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinitionName, S Response deleteWithResponse(String policySetDefinitionName, String policyDefinitionVersion, Context context); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -331,83 +216,64 @@ PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinitionName, S void delete(String policySetDefinitionName, String policyDefinitionVersion); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String policySetDefinitionName, - String policyDefinitionVersion, String expand); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String policySetDefinitionName, String expand, Integer top); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String policySetDefinitionName, String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String policySetDefinitionName); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @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 policy set definition version along with {@link Response}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String policySetDefinitionName, - String policyDefinitionVersion, String expand, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String policySetDefinitionName); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @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 policy set definition version. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionVersionInner get(String policySetDefinitionName, String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String policySetDefinitionName, String expand, Integer top, + Context context); /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -425,8 +291,6 @@ Mono> getBuiltInWithResponseAsync(Stri String policyDefinitionVersion, String expand); /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -442,8 +306,6 @@ Mono getBuiltInAsync(String policySetDefinition String policyDefinitionVersion); /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -462,8 +324,6 @@ Response getBuiltInWithResponse(String policySe String policyDefinitionVersion, String expand, Context context); /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -478,9 +338,8 @@ Response getBuiltInWithResponse(String policySe PolicySetDefinitionVersionInner getBuiltIn(String policySetDefinitionName, String policyDefinitionVersion); /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -489,43 +348,42 @@ Response getBuiltInWithResponse(String policySe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String policySetDefinitionName, String expand, Integer top); + PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, + Integer top); /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String policySetDefinitionName); + PagedFlux listBuiltInAsync(String policySetDefinitionName); /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String policySetDefinitionName); + PagedIterable listBuiltIn(String policySetDefinitionName); /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -535,84 +393,87 @@ Response getBuiltInWithResponse(String policySe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String policySetDefinitionName, String expand, Integer top, - Context context); + PagedIterable listBuiltIn(String policySetDefinitionName, String expand, + Integer top, Context context); /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, - Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getAtManagementGroupWithResponseAsync(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion, String expand); /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the policy set definition version on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listBuiltInAsync(String policySetDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAtManagementGroupAsync(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion); /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the policy set definition version along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(String policySetDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtManagementGroupWithResponse(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion, String expand, Context context); /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the policy set definition version. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBuiltIn(String policySetDefinitionName, String expand, - Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PolicySetDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policySetDefinitionName, + String policyDefinitionVersion); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -632,8 +493,6 @@ Mono> createOrUpdateAtManagementGroupW PolicySetDefinitionVersionInner parameters); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -652,8 +511,6 @@ Mono createOrUpdateAtManagementGroupAsync(Strin String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -674,8 +531,6 @@ Response createOrUpdateAtManagementGroupWithRes Context context); /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -694,8 +549,6 @@ PolicySetDefinitionVersionInner createOrUpdateAtManagementGroup(String managemen String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -713,8 +566,6 @@ Mono> deleteAtManagementGroupWithResponseAsync(String managementG String policySetDefinitionName, String policyDefinitionVersion); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -732,8 +583,6 @@ Mono deleteAtManagementGroupAsync(String managementGroupName, String polic String policyDefinitionVersion); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -752,8 +601,6 @@ Response deleteAtManagementGroupWithResponse(String managementGroupName, S String policyDefinitionVersion, Context context); /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -770,158 +617,237 @@ void deleteAtManagementGroup(String managementGroupName, String policySetDefinit String policyDefinitionVersion); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion, String expand); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByManagementGroupAsync(String managementGroupName, + String policySetDefinitionName, String expand, Integer top); /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByManagementGroupAsync(String managementGroupName, + String policySetDefinitionName); /** - * Retrieves a policy set definition version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagementGroup(String managementGroupName, + String policySetDefinitionName); + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @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 policy set definition version along with {@link Response}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagementGroup(String managementGroupName, + String policySetDefinitionName, String expand, Integer top, Context context); + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion, String expand, Context context); + Mono> listAllBuiltinsWithResponseAsync(); /** - * Retrieves a policy set definition version. + * Lists all built-in policy set definition versions. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllBuiltinsAsync(); + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @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 policy set definition version. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policySetDefinitionName, - String policyDefinitionVersion); + Response listAllBuiltinsWithResponse(Context context); /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all built-in policy set definition versions. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicySetDefinitionVersionListResultInner listAllBuiltins(); + + /** + * Lists all policy set definition versions at management group scope. + * + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByManagementGroupAsync(String managementGroupName, - String policySetDefinitionName, String expand, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName); /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByManagementGroupAsync(String managementGroupName, - String policySetDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllAtManagementGroupAsync(String managementGroupName); /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. + * @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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupName, - String policySetDefinitionName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllAtManagementGroupWithResponse(String managementGroupName, + Context context); /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicySetDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName); + + /** + * Lists all policy set definition versions within a subscription. + * + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> listAllWithResponseAsync(); + + /** + * Lists all policy set definition versions within a subscription. + * + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listAllAsync(); + + /** + * Lists all policy set definition versions within a subscription. + * + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByManagementGroup(String managementGroupName, - String policySetDefinitionName, String expand, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAllWithResponse(Context context); + + /** + * Lists all policy set definition versions within a subscription. + * + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicySetDefinitionVersionListResultInner listAll(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionsClient.java index a3146bb00b67..ce68165e1664 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -18,44 +18,37 @@ */ public interface PolicySetDefinitionsClient { /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, - PolicySetDefinitionInner parameters); + Mono> getWithResponseAsync(String policySetDefinitionName, String expand); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String policySetDefinitionName, - PolicySetDefinitionInner parameters); + Mono getAsync(String policySetDefinitionName); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @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. @@ -63,118 +56,53 @@ Mono createOrUpdateAsync(String policySetDefinitionNam * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String policySetDefinitionName, - PolicySetDefinitionInner parameters, Context context); + Response getWithResponse(String policySetDefinitionName, String expand, Context context); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, PolicySetDefinitionInner parameters); - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String policySetDefinitionName); - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String policySetDefinitionName); - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String policySetDefinitionName, Context context); - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String policySetDefinitionName); + PolicySetDefinitionInner get(String policySetDefinitionName); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String policySetDefinitionName, String expand); + Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, + PolicySetDefinitionInner parameters); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String policySetDefinitionName); + Mono createOrUpdateAsync(String policySetDefinitionName, + PolicySetDefinitionInner parameters); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param parameters The policy set definition properties. * @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. @@ -182,87 +110,71 @@ Response createOrUpdateWithResponse(String policySetDe * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String policySetDefinitionName, String expand, Context context); + Response createOrUpdateWithResponse(String policySetDefinitionName, + PolicySetDefinitionInner parameters, Context context); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionInner get(String policySetDefinitionName); + PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, PolicySetDefinitionInner parameters); /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, String expand); + Mono> deleteWithResponseAsync(String policySetDefinitionName); /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuiltInAsync(String policySetDefinitionName); + Mono deleteAsync(String policySetDefinitionName); /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @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 policy set definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuiltInWithResponse(String policySetDefinitionName, String expand, - Context context); + Response deleteWithResponse(String policySetDefinitionName, Context context); /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionInner getBuiltIn(String policySetDefinitionName); + void delete(String policySetDefinitionName); /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -286,14 +198,12 @@ Response getBuiltInWithResponse(String policySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(String filter, String expand, Integer top); /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -306,14 +216,12 @@ Response getBuiltInWithResponse(String policySetDefini * * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -326,14 +234,12 @@ Response getBuiltInWithResponse(String policySetDefini * * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -358,14 +264,66 @@ Response getBuiltInWithResponse(String policySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String filter, String expand, Integer top, Context context); /** - * Retrieves built-in policy set definitions. + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, String expand); + + /** + * This operation retrieves the built-in policy set definition with the given name. * + * @param policySetDefinitionName The name of the policy set definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBuiltInAsync(String policySetDefinitionName); + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @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 policy set definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuiltInWithResponse(String policySetDefinitionName, String expand, + Context context); + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PolicySetDefinitionInner getBuiltIn(String policySetDefinitionName); + + /** * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -383,42 +341,36 @@ Response getBuiltInWithResponse(String policySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listBuiltInAsync(String filter, String expand, Integer top); /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. * * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listBuiltInAsync(); /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. * * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listBuiltIn(); /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -437,53 +389,47 @@ Response getBuiltInWithResponse(String policySetDefini * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listBuiltIn(String filter, String expand, Integer top, Context context); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters); + Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName, String expand); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters); + Mono getAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @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. @@ -491,158 +437,138 @@ Mono createOrUpdateAtManagementGroupAsync(String manag * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters, Context context); + Response getAtManagementGroupWithResponse(String managementGroupId, + String policySetDefinitionName, String expand, Context context); /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policySetDefinitionName, - PolicySetDefinitionInner parameters); + PolicySetDefinitionInner getAtManagementGroup(String managementGroupId, String policySetDefinitionName); /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName); + Mono> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters); /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName); + Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters); /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAtManagementGroupWithResponse(String managementGroupId, String policySetDefinitionName, - Context context); + Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters, Context context); /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtManagementGroup(String managementGroupId, String policySetDefinitionName); + PolicySetDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policySetDefinitionName, + PolicySetDefinitionInner parameters); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName, String expand); + Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName); + Mono deleteAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @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 policy set definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtManagementGroupWithResponse(String managementGroupId, - String policySetDefinitionName, String expand, Context context); + Response deleteAtManagementGroupWithResponse(String managementGroupId, String policySetDefinitionName, + Context context); /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - PolicySetDefinitionInner getAtManagementGroup(String managementGroupId, String policySetDefinitionName); + void deleteAtManagementGroup(String managementGroupId, String policySetDefinitionName); /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -667,15 +593,13 @@ Response getAtManagementGroupWithResponse(String manag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, String expand, Integer top); /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -690,14 +614,12 @@ PagedFlux listByManagementGroupAsync(String management * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByManagementGroupAsync(String managementGroupId); /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -712,14 +634,12 @@ PagedFlux listByManagementGroupAsync(String management * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByManagementGroup(String managementGroupId); /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -745,7 +665,7 @@ PagedFlux listByManagementGroupAsync(String management * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByManagementGroup(String managementGroupId, String filter, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyTokensClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyTokensClient.java index 4948143fbfe2..395775683a9a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyTokensClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyTokensClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -21,7 +21,7 @@ public interface PolicyTokensClient { * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -36,7 +36,7 @@ public interface PolicyTokensClient { * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -50,7 +50,7 @@ public interface PolicyTokensClient { * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,7 +65,7 @@ public interface PolicyTokensClient { * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -79,7 +79,7 @@ public interface PolicyTokensClient { * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -96,7 +96,7 @@ Mono> acquireAtManagementGroupWithResponseAsy * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,7 +112,7 @@ Mono acquireAtManagementGroupAsync(String managementGr * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,7 +129,7 @@ Response acquireAtManagementGroupWithResponse(String m * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProviderResourceTypesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProviderResourceTypesClient.java index 64a127607842..7827c422dd53 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProviderResourceTypesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProviderResourceTypesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -19,8 +19,7 @@ public interface ProviderResourceTypesClient { * List the resource types for a specified resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. + * @param expand The $expand query parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -47,8 +46,7 @@ Mono> listWithResponseAsync(String * List the resource types for a specified resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. + * @param expand The $expand query parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java index 585840926c46..db8852b114be 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -19,6 +19,51 @@ * An instance of this class provides access to all the operations defined in ProvidersClient. */ public interface ProvidersClient { + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtTenantScopeAsync(String expand); + + /** + * Gets all resource providers for the tenant. + * + * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAtTenantScopeAsync(); + + /** + * Gets all resource providers for the tenant. + * + * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(); + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @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 resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String expand, Context context); + /** * Unregisters a subscription from a resource provider. * @@ -73,8 +118,8 @@ public interface ProvidersClient { * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -89,8 +134,8 @@ Mono> registerAtManagementGroupScopeWithResponseAsync(String reso * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -104,8 +149,8 @@ Mono> registerAtManagementGroupScopeWithResponseAsync(String reso * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -121,8 +166,8 @@ Response registerAtManagementGroupScopeWithResponse(String resourceProvide * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -283,55 +328,6 @@ Response registerWithResponse(String resourceProviderNamespace, @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String expand, Context context); - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(String expand); - - /** - * Gets all resource providers for the tenant. - * - * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAtTenantScopeAsync(); - - /** - * Gets all resource providers for the tenant. - * - * @throws com.azure.core.management.exception.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 resource providers for the tenant as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(); - - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @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 resource providers for the tenant as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAtTenantScope(String expand, Context context); - /** * Gets the specified resource provider. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java index e3e456f8f30b..d5cca0e6e7cf 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -25,10 +25,59 @@ * An instance of this class provides access to all the operations defined in ResourceGroupsClient. */ public interface ResourceGroupsClient { + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, Context context); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupInner get(String resourceGroupName); + /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -40,7 +89,7 @@ public interface ResourceGroupsClient { /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -52,7 +101,7 @@ public interface ResourceGroupsClient { /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -65,7 +114,7 @@ public interface ResourceGroupsClient { /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -77,9 +126,7 @@ public interface ResourceGroupsClient { /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -93,9 +140,7 @@ Mono> createOrUpdateWithResponseAsync(String resour /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -108,9 +153,7 @@ Mono> createOrUpdateWithResponseAsync(String resour /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,9 +168,7 @@ Response createOrUpdateWithResponse(String resourceGroupName /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -137,13 +178,80 @@ Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters); + /** + * Updates a resource group. + * + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, + ResourceGroupPatchable parameters); + + /** + * Updates a resource group. + * + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters); + + /** + * Updates a resource group. + * + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, ResourceGroupPatchable parameters, + Context context); + + /** + * Updates a resource group. + * + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters); + /** * Deletes a resource group. * * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -160,7 +268,7 @@ Response createOrUpdateWithResponse(String resourceGroupName * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -177,7 +285,7 @@ Response createOrUpdateWithResponse(String resourceGroupName * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -192,7 +300,7 @@ Response createOrUpdateWithResponse(String resourceGroupName * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -207,7 +315,7 @@ Response createOrUpdateWithResponse(String resourceGroupName * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -226,7 +334,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -243,7 +351,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -258,7 +366,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -272,7 +380,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -284,125 +392,58 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String forceDeletionTypes, Context context); /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName); - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, Context context); - - /** - * Gets a resource group. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupInner get(String resourceGroupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter, Integer top); /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync(String resourceGroupName, - ResourceGroupPatchable parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information on successful completion of {@link Mono}. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @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 resource group information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, ResourceGroupPatchable parameters, - Context context); - - /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -416,7 +457,7 @@ Mono>> exportTemplateWithResponseAsync(String resource /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -430,7 +471,7 @@ Mono>> exportTemplateWithResponseAsync(String resource /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -444,7 +485,7 @@ Mono>> exportTemplateWithResponseAsync(String resource /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -459,7 +500,7 @@ Mono>> exportTemplateWithResponseAsync(String resource /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -473,7 +514,7 @@ Mono exportTemplateAsync(String resourceGroupNam /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -486,7 +527,7 @@ Mono exportTemplateAsync(String resourceGroupNam /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -497,53 +538,4 @@ Mono exportTemplateAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters, Context context); - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 resource groups for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, Integer top); - - /** - * Gets all the resource groups for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Gets all the resource groups for a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @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 resource groups for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Integer top, Context context); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java index 9cee3c904b92..c8dd084a45c0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -12,26 +12,26 @@ */ public interface ResourceManagementClient { /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -54,37 +54,37 @@ public interface ResourceManagementClient { OperationsClient getOperations(); /** - * Gets the ProvidersClient object to access its operations. + * Gets the ResourceGroupsClient object to access its operations. * - * @return the ProvidersClient object. + * @return the ResourceGroupsClient object. */ - ProvidersClient getProviders(); + ResourceGroupsClient getResourceGroups(); /** - * Gets the ProviderResourceTypesClient object to access its operations. + * Gets the ResourcesClient object to access its operations. * - * @return the ProviderResourceTypesClient object. + * @return the ResourcesClient object. */ - ProviderResourceTypesClient getProviderResourceTypes(); + ResourcesClient getResources(); /** - * Gets the ResourcesClient object to access its operations. + * Gets the TagOperationsClient object to access its operations. * - * @return the ResourcesClient object. + * @return the TagOperationsClient object. */ - ResourcesClient getResources(); + TagOperationsClient getTagOperations(); /** - * Gets the ResourceGroupsClient object to access its operations. + * Gets the ProvidersClient object to access its operations. * - * @return the ResourceGroupsClient object. + * @return the ProvidersClient object. */ - ResourceGroupsClient getResourceGroups(); + ProvidersClient getProviders(); /** - * Gets the TagOperationsClient object to access its operations. + * Gets the ProviderResourceTypesClient object to access its operations. * - * @return the TagOperationsClient object. + * @return the ProviderResourceTypesClient object. */ - TagOperationsClient getTagOperations(); + ProviderResourceTypesClient getProviderResourceTypes(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java index c964fd72941c..fa323c630166 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -22,7 +22,7 @@ public interface ResourceNamesClient { * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with * a reserved word. * - * @param resourceNameDefinition Resource object with values for resource name and resource type. + * @param resourceNameDefinition The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -53,7 +53,7 @@ public interface ResourceNamesClient { * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with * a reserved word. * - * @param resourceNameDefinition Resource object with values for resource name and resource type. + * @param resourceNameDefinition The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java index ddd0146c81e4..55f2ee47e3a8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -28,7 +28,7 @@ public interface ResourcesClient extends InnerSupportsListing listByResourceGroupAsync(String resource /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -68,7 +68,7 @@ PagedFlux listByResourceGroupAsync(String resource /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -80,7 +80,7 @@ PagedFlux listByResourceGroupAsync(String resource /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -114,8 +114,7 @@ PagedIterable listByResourceGroup(String resourceG * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,8 +133,7 @@ Mono>> moveResourcesWithResponseAsync(String sourceRes * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -154,8 +152,7 @@ PollerFlux, Void> beginMoveResourcesAsync(String sourceResource * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -173,8 +170,7 @@ PollerFlux, Void> beginMoveResourcesAsync(String sourceResource * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -194,8 +190,7 @@ SyncPoller, Void> beginMoveResources(String sourceResourceGroup * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -213,8 +208,7 @@ SyncPoller, Void> beginMoveResources(String sourceResourceGroup * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -231,8 +225,7 @@ SyncPoller, Void> beginMoveResources(String sourceResourceGroup * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -251,8 +244,7 @@ SyncPoller, Void> beginMoveResources(String sourceResourceGroup * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -272,8 +264,7 @@ Mono>> validateMoveResourcesWithResponseAsync(String s * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -293,8 +284,7 @@ PollerFlux, Void> beginValidateMoveResourcesAsync(String source * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -314,8 +304,7 @@ SyncPoller, Void> beginValidateMoveResources(String sourceResou * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -336,8 +325,7 @@ SyncPoller, Void> beginValidateMoveResources(String sourceResou * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -356,8 +344,7 @@ SyncPoller, Void> beginValidateMoveResources(String sourceResou * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -375,8 +362,7 @@ SyncPoller, Void> beginValidateMoveResources(String sourceResou * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -387,372 +373,276 @@ SyncPoller, Void> beginValidateMoveResources(String sourceResou void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resources in a subscription as paginated response with {@link PagedFlux}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String filter, String expand, Integer top); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion); /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resources in a subscription as paginated response with {@link PagedFlux}. + * @return whether resource exists on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono checkExistenceByIdAsync(String resourceId, String apiVersion); /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @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 resources in a subscription as paginated response with {@link PagedIterable}. + * @return whether resource exists along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context); /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. - * @param context The context to associate with this operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resources in a subscription as paginated response with {@link PagedIterable}. + * @return whether resource exists. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, String expand, Integer top, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceById(String resourceId, String apiVersion); /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); + Mono> getByIdWithResponseAsync(String resourceId, String apiVersion); /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 whether resource exists on successful completion of {@link Mono}. + * @return a resource by ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); + Mono getByIdAsync(String resourceId, String apiVersion); /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @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 whether resource exists along with {@link Response}. + * @return a resource by ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceWithResponse(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context); + Response getByIdWithResponse(String resourceId, String apiVersion, Context context); /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 whether resource exists. + * @return a resource by ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion); + GenericResourceInner getById(String resourceId, String apiVersion); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); + Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); + PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, + String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion); + SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context); + SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters, Context context); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion); + Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + GenericResourceInner parameters); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion); + GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion, Context context); + GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters, + Context context); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters); + Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters); + PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, + String apiVersion, GenericResourceInner parameters); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginCreateOrUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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. @@ -760,60 +650,43 @@ SyncPoller, GenericResourceInner> beginCreateOr * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginCreateOrUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters, Context context); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters); + Mono updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters); + GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters); /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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. @@ -821,461 +694,478 @@ GenericResourceInner createOrUpdate(String resourceGroupName, String resourcePro * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters, Context context); + GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters, + Context context); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters); + Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 PollerFlux} for polling of resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, GenericResourceInner> beginUpdateAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters); + PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters); + SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters, Context context); + SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters); + Mono deleteByIdAsync(String resourceId, String apiVersion); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for 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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); + void deleteById(String resourceId, String apiVersion); /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context); + void deleteById(String resourceId, String apiVersion, Context context); /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource along with {@link Response} on successful completion of {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion); + Mono> checkExistenceWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource on successful completion of {@link Mono}. + * @return whether resource exists on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String resourceProviderNamespace, + Mono checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource along with {@link Response}. + * @return whether resource exists along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceProviderNamespace, + Response checkExistenceWithResponse(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context); /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. + * @return whether resource exists. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion); + Mono> getWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion); /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 whether resource exists on successful completion of {@link Mono}. + * @return a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkExistenceByIdAsync(String resourceId, String apiVersion); + Mono getAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @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 whether resource exists along with {@link Response}. + * @return a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context); + Response getWithResponse(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context); /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 whether resource exists. + * @return a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkExistenceById(String resourceId, String apiVersion); + GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion); + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion); + PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion); + SyncPoller, GenericResourceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context); + SyncPoller, GenericResourceInner> beginCreateOrUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters, Context context); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteByIdAsync(String resourceId, String apiVersion); + Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteById(String resourceId, String apiVersion); + GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters); /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteById(String resourceId, String apiVersion, Context context); + GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters, Context context); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, + Mono>> updateWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync(String resourceId, + PollerFlux, GenericResourceInner> beginUpdateAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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. @@ -1283,50 +1173,62 @@ SyncPoller, GenericResourceInner> beginCreateOr * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); + GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters); /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @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. @@ -1334,186 +1236,226 @@ Mono createOrUpdateByIdAsync(String resourceId, String api * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters, - Context context); + GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, - GenericResourceInner parameters); + Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 PollerFlux} for polling of resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, - String apiVersion, GenericResourceInner parameters); + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, - String apiVersion, GenericResourceInner parameters); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, - String apiVersion, GenericResourceInner parameters, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters); + Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for 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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters); + void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion); /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @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 resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters, - Context context); + void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion, Context context); /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByIdWithResponseAsync(String resourceId, String apiVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String filter, String expand, Integer top); /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID on successful completion of {@link Mono}. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByIdAsync(String resourceId, String apiVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID along with {@link Response}. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByIdWithResponse(String resourceId, String apiVersion, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - GenericResourceInner getById(String resourceId, String apiVersion); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String expand, Integer top, Context context); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java index 731f29215f76..abdb5a610066 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -12,14 +12,14 @@ */ public interface SubscriptionClient { /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionFeatureRegistrationsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionFeatureRegistrationsClient.java index 2480d8960d52..ad8c4431c363 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionFeatureRegistrationsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionFeatureRegistrationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java index 268d39ea977c..f3806f327d26 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -26,12 +26,15 @@ public interface SubscriptionsClient { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedFlux}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listLocationsAsync(String subscriptionId, Boolean includeExtendedLocations); @@ -42,11 +45,14 @@ public interface SubscriptionsClient { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedFlux}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listLocationsAsync(String subscriptionId); @@ -57,11 +63,14 @@ public interface SubscriptionsClient { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedIterable}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listLocations(String subscriptionId); @@ -72,13 +81,16 @@ public interface SubscriptionsClient { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @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 location list operation response as paginated response with {@link PagedIterable}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listLocations(String subscriptionId, Boolean includeExtendedLocations, @@ -87,7 +99,7 @@ PagedIterable listLocations(String subscriptionId, Boolean includ /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -100,7 +112,7 @@ PagedIterable listLocations(String subscriptionId, Boolean includ /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -112,7 +124,7 @@ PagedIterable listLocations(String subscriptionId, Boolean includ /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @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. @@ -125,7 +137,7 @@ PagedIterable listLocations(String subscriptionId, Boolean includ /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -169,8 +181,8 @@ PagedIterable listLocations(String subscriptionId, Boolean includ /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -184,8 +196,8 @@ Mono> checkZonePeersWithResponseAsync(String /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -197,8 +209,8 @@ Mono> checkZonePeersWithResponseAsync(String /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -212,8 +224,8 @@ Response checkZonePeersWithResponse(String subscripti /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java index 54be725b5782..9257ed920089 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; @@ -26,695 +26,707 @@ */ public interface TagOperationsClient { /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteValueWithResponseAsync(String tagName, String tagValue); + Mono> getAtScopeWithResponseAsync(String scope); /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the entire set of tags on a resource or subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteValueAsync(String tagName, String tagValue); + Mono getAtScopeAsync(String scope); /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the entire set of tags on a resource or subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteValueWithResponse(String tagName, String tagValue, Context context); + Response getAtScopeWithResponse(String scope, Context context); /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteValue(String tagName, String tagValue); + TagsResourceInner getAtScope(String scope); /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information along with {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue); + Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, TagsResourceInner parameters); /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateValueAsync(String tagName, String tagValue); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, + TagsResourceInner parameters); /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information along with {@link Response}. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, + TagsResourceInner parameters); /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - TagValueInner createOrUpdateValue(String tagName, String tagValue); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, + TagsResourceInner parameters, Context context); /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details along with {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createOrUpdateWithResponseAsync(String tagName); + Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters); /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String tagName); + TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters); /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details along with {@link Response}. + * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String tagName, Context context); + TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context); /** - * Creates a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagDetailsInner createOrUpdate(String tagName); + Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters); /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync(String tagName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, + TagsPatchResource parameters); /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String tagName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, + TagsPatchResource parameters); /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String tagName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, + TagsPatchResource parameters, Context context); /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String tagName); + Mono updateAtScopeAsync(String scope, TagsPatchResource parameters); /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags as paginated response with {@link PagedFlux}. + * @return wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters); /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws com.azure.core.management.exception.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 subscription tags as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a summary of tag usage under the subscription. - * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags as paginated response with {@link PagedIterable}. + * @return wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, TagsResourceInner parameters); + Mono>> deleteAtScopeWithResponseAsync(String scope); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, - TagsResourceInner parameters); + PollerFlux, Void> beginDeleteAtScopeAsync(String scope); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, - TagsResourceInner parameters); + SyncPoller, Void> beginDeleteAtScope(String scope); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, - TagsResourceInner parameters, Context context); + SyncPoller, Void> beginDeleteAtScope(String scope, Context context); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters); + Mono deleteAtScopeAsync(String scope); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters); + void deleteAtScope(String scope); /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context); + void deleteAtScope(String scope, Context context); /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters); + Mono> deleteValueWithResponseAsync(String tagName, String tagValue); /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 wrapper resource for tags API requests and responses. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, - TagsPatchResource parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteValueAsync(String tagName, String tagValue); /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @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 wrapper resource for tags API requests and responses. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, - TagsPatchResource parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteValueWithResponse(String tagName, String tagValue, Context context); /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, - TagsPatchResource parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteValue(String tagName, String tagValue); /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return tag information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAtScopeAsync(String scope, TagsPatchResource parameters); + Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue); /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. + * @return tag information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters); + Mono createOrUpdateValueAsync(String tagName, String tagValue); /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @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 wrapper resource for tags API requests and responses. + * @return tag information along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context); + Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context); /** - * Gets the entire set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * @param scope The resource scope. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion - * of {@link Mono}. + * @return tag information. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAtScopeWithResponseAsync(String scope); + TagValueInner createOrUpdateValue(String tagName, String tagValue); /** - * Gets the entire set of tags on a resource or subscription. + * Creates a predefined tag name. + * + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. * - * @param scope The resource scope. + * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription on successful completion of {@link Mono}. + * @return tag details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAtScopeAsync(String scope); + Mono> createOrUpdateWithResponseAsync(String tagName); /** - * Gets the entire set of tags on a resource or subscription. + * Creates a predefined tag name. * - * @param scope The resource scope. - * @param context The context to associate with this operation. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription along with {@link Response}. + * @return tag details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAtScopeWithResponse(String scope, Context context); + Mono createOrUpdateAsync(String tagName); /** - * Gets the entire set of tags on a resource or subscription. + * Creates a predefined tag name. + * + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. * - * @param scope The resource scope. + * @param tagName The name of the tag to create. + * @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 entire set of tags on a resource or subscription. + * @return tag details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TagsResourceInner getAtScope(String scope); + Response createOrUpdateWithResponse(String tagName, Context context); /** - * Deletes the entire set of tags on a resource or subscription. + * Creates a predefined tag name. * - * @param scope The resource scope. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return tag details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteAtScopeWithResponseAsync(String scope); + TagDetailsInner createOrUpdate(String tagName); /** - * Deletes the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAtScopeAsync(String scope); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String tagName); /** - * Deletes the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. * - * @param scope The resource scope. + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. + * + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtScope(String scope); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String tagName); /** - * Deletes the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteAtScope(String scope, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String tagName, Context context); /** - * Deletes the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAtScopeAsync(String scope); + void delete(String tagName); /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteAtScope(String scope, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java index cd54bcb36e76..00cfca97c100 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java index 63153975fb1d..f9a8f74a33d8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ChangeResourceResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java index d256286a102a..7d0b9e75ae28 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word. */ -@Fluent +@Immutable public final class CheckResourceNameResultInner implements JsonSerializable { /* * Name of Resource @@ -35,7 +35,7 @@ public final class CheckResourceNameResultInner implements JsonSerializable { /* * The subscription ID. @@ -36,7 +36,7 @@ public final class CheckZonePeersResultInner implements JsonSerializable availabilityZonePeers() { return this.availabilityZonePeers; } - /** - * Set the availabilityZonePeers property: The Availability Zones shared by the subscriptions. - * - * @param availabilityZonePeers the availabilityZonePeers value to set. - * @return the CheckZonePeersResultInner object itself. - */ - public CheckZonePeersResultInner withAvailabilityZonePeers(List availabilityZonePeers) { - this.availabilityZonePeers = availabilityZonePeers; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataBoundaryDefinitionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataBoundaryDefinitionInner.java index 78c4989734c4..36cba986839f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataBoundaryDefinitionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataBoundaryDefinitionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java index cd691970ae08..6dd780d49451 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The resource functions supported by a manifest. */ -@Fluent +@Immutable public final class DataManifestResourceFunctionsDefinition implements JsonSerializable { /* @@ -25,14 +25,14 @@ public final class DataManifestResourceFunctionsDefinition private List standard; /* - * An array of data manifest custom resource definition. + * An array of data manifest custom resource definitions. */ private List custom; /** * Creates an instance of DataManifestResourceFunctionsDefinition class. */ - public DataManifestResourceFunctionsDefinition() { + private DataManifestResourceFunctionsDefinition() { } /** @@ -45,18 +45,7 @@ public List standard() { } /** - * Set the standard property: The standard resource functions (subscription and/or resourceGroup). - * - * @param standard the standard value to set. - * @return the DataManifestResourceFunctionsDefinition object itself. - */ - public DataManifestResourceFunctionsDefinition withStandard(List standard) { - this.standard = standard; - return this; - } - - /** - * Get the custom property: An array of data manifest custom resource definition. + * Get the custom property: An array of data manifest custom resource definitions. * * @return the custom value. */ @@ -64,18 +53,6 @@ public List custom() { return this.custom; } - /** - * Set the custom property: An array of data manifest custom resource definition. - * - * @param custom the custom value to set. - * @return the DataManifestResourceFunctionsDefinition object itself. - */ - public DataManifestResourceFunctionsDefinition - withCustom(List custom) { - this.custom = custom; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java index cf4cd45c3d0b..4a3bf2036d2f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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; @@ -18,13 +19,18 @@ /** * The data policy manifest. */ -@Fluent +@Immutable public final class DataPolicyManifestInner extends ProxyResource { /* - * The data policy manifest properties. + * The resource-specific properties for this resource. */ private DataPolicyManifestProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,11 +49,11 @@ public final class DataPolicyManifestInner extends ProxyResource { /** * Creates an instance of DataPolicyManifestInner class. */ - public DataPolicyManifestInner() { + private DataPolicyManifestInner() { } /** - * Get the innerProperties property: The data policy manifest properties. + * Get the innerProperties property: The resource-specific properties for this resource. * * @return the innerProperties value. */ @@ -55,6 +61,15 @@ private DataPolicyManifestProperties innerProperties() { return this.innerProperties; } + /** + * 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. * @@ -94,20 +109,6 @@ public List namespaces() { return this.innerProperties() == null ? null : this.innerProperties().namespaces(); } - /** - * Set the namespaces property: The list of namespaces for the data policy manifest. - * - * @param namespaces the namespaces value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withNamespaces(List namespaces) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withNamespaces(namespaces); - return this; - } - /** * Get the policyMode property: The policy mode of the data policy manifest. * @@ -117,20 +118,6 @@ public String policyMode() { return this.innerProperties() == null ? null : this.innerProperties().policyMode(); } - /** - * Set the policyMode property: The policy mode of the data policy manifest. - * - * @param policyMode the policyMode value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withPolicyMode(String policyMode) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withPolicyMode(policyMode); - return this; - } - /** * Get the isBuiltInOnly property: A value indicating whether policy mode is allowed only in built-in definitions. * @@ -140,20 +127,6 @@ public Boolean isBuiltInOnly() { return this.innerProperties() == null ? null : this.innerProperties().isBuiltInOnly(); } - /** - * Set the isBuiltInOnly property: A value indicating whether policy mode is allowed only in built-in definitions. - * - * @param isBuiltInOnly the isBuiltInOnly value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withIsBuiltInOnly(Boolean isBuiltInOnly) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withIsBuiltInOnly(isBuiltInOnly); - return this; - } - /** * Get the resourceTypeAliases property: An array of resource type aliases. * @@ -163,20 +136,6 @@ public List resourceTypeAliases() { return this.innerProperties() == null ? null : this.innerProperties().resourceTypeAliases(); } - /** - * Set the resourceTypeAliases property: An array of resource type aliases. - * - * @param resourceTypeAliases the resourceTypeAliases value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withResourceTypeAliases(List resourceTypeAliases) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withResourceTypeAliases(resourceTypeAliases); - return this; - } - /** * Get the effects property: The effect definition. * @@ -186,20 +145,6 @@ public List effects() { return this.innerProperties() == null ? null : this.innerProperties().effects(); } - /** - * Set the effects property: The effect definition. - * - * @param effects the effects value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withEffects(List effects) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withEffects(effects); - return this; - } - /** * Get the fieldValues property: The non-alias field accessor values that can be used in the policy rule. * @@ -209,20 +154,6 @@ public List fieldValues() { return this.innerProperties() == null ? null : this.innerProperties().fieldValues(); } - /** - * Set the fieldValues property: The non-alias field accessor values that can be used in the policy rule. - * - * @param fieldValues the fieldValues value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withFieldValues(List fieldValues) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withFieldValues(fieldValues); - return this; - } - /** * Get the standard property: The standard resource functions (subscription and/or resourceGroup). * @@ -233,21 +164,7 @@ public List standard() { } /** - * Set the standard property: The standard resource functions (subscription and/or resourceGroup). - * - * @param standard the standard value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withStandard(List standard) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withStandard(standard); - return this; - } - - /** - * Get the custom property: An array of data manifest custom resource definition. + * Get the custom property: An array of data manifest custom resource definitions. * * @return the custom value. */ @@ -255,20 +172,6 @@ public List custom() { return this.innerProperties() == null ? null : this.innerProperties().custom(); } - /** - * Set the custom property: An array of data manifest custom resource definition. - * - * @param custom the custom value to set. - * @return the DataPolicyManifestInner object itself. - */ - public DataPolicyManifestInner withCustom(List custom) { - if (this.innerProperties() == null) { - this.innerProperties = new DataPolicyManifestProperties(); - } - this.innerProperties().withCustom(custom); - return this; - } - /** * Validates the instance. * @@ -314,6 +217,8 @@ public static DataPolicyManifestInner fromJson(JsonReader jsonReader) throws IOE deserializedDataPolicyManifestInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedDataPolicyManifestInner.innerProperties = DataPolicyManifestProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataPolicyManifestInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java index 55ff50b7f52a..a04ceb447f83 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * The properties of the data policy manifest. */ -@Fluent +@Immutable public final class DataPolicyManifestProperties implements JsonSerializable { /* * The list of namespaces for the data policy manifest. @@ -58,7 +58,7 @@ public final class DataPolicyManifestProperties implements JsonSerializable namespaces() { return this.namespaces; } - /** - * Set the namespaces property: The list of namespaces for the data policy manifest. - * - * @param namespaces the namespaces value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withNamespaces(List namespaces) { - this.namespaces = namespaces; - return this; - } - /** * Get the policyMode property: The policy mode of the data policy manifest. * @@ -90,17 +79,6 @@ public String policyMode() { return this.policyMode; } - /** - * Set the policyMode property: The policy mode of the data policy manifest. - * - * @param policyMode the policyMode value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withPolicyMode(String policyMode) { - this.policyMode = policyMode; - return this; - } - /** * Get the isBuiltInOnly property: A value indicating whether policy mode is allowed only in built-in definitions. * @@ -110,17 +88,6 @@ public Boolean isBuiltInOnly() { return this.isBuiltInOnly; } - /** - * Set the isBuiltInOnly property: A value indicating whether policy mode is allowed only in built-in definitions. - * - * @param isBuiltInOnly the isBuiltInOnly value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withIsBuiltInOnly(Boolean isBuiltInOnly) { - this.isBuiltInOnly = isBuiltInOnly; - return this; - } - /** * Get the resourceTypeAliases property: An array of resource type aliases. * @@ -130,17 +97,6 @@ public List resourceTypeAliases() { return this.resourceTypeAliases; } - /** - * Set the resourceTypeAliases property: An array of resource type aliases. - * - * @param resourceTypeAliases the resourceTypeAliases value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withResourceTypeAliases(List resourceTypeAliases) { - this.resourceTypeAliases = resourceTypeAliases; - return this; - } - /** * Get the effects property: The effect definition. * @@ -150,17 +106,6 @@ public List effects() { return this.effects; } - /** - * Set the effects property: The effect definition. - * - * @param effects the effects value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withEffects(List effects) { - this.effects = effects; - return this; - } - /** * Get the fieldValues property: The non-alias field accessor values that can be used in the policy rule. * @@ -170,17 +115,6 @@ public List fieldValues() { return this.fieldValues; } - /** - * Set the fieldValues property: The non-alias field accessor values that can be used in the policy rule. - * - * @param fieldValues the fieldValues value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withFieldValues(List fieldValues) { - this.fieldValues = fieldValues; - return this; - } - /** * Get the innerResourceFunctions property: The resource functions definition specified in the data manifest. * @@ -200,21 +134,7 @@ public List standard() { } /** - * Set the standard property: The standard resource functions (subscription and/or resourceGroup). - * - * @param standard the standard value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withStandard(List standard) { - if (this.innerResourceFunctions() == null) { - this.innerResourceFunctions = new DataManifestResourceFunctionsDefinition(); - } - this.innerResourceFunctions().withStandard(standard); - return this; - } - - /** - * Get the custom property: An array of data manifest custom resource definition. + * Get the custom property: An array of data manifest custom resource definitions. * * @return the custom value. */ @@ -222,20 +142,6 @@ public List custom() { return this.innerResourceFunctions() == null ? null : this.innerResourceFunctions().custom(); } - /** - * Set the custom property: An array of data manifest custom resource definition. - * - * @param custom the custom value to set. - * @return the DataPolicyManifestProperties object itself. - */ - public DataPolicyManifestProperties withCustom(List custom) { - if (this.innerResourceFunctions() == null) { - this.innerResourceFunctions = new DataManifestResourceFunctionsDefinition(); - } - this.innerResourceFunctions().withCustom(custom); - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java index a15af2a702d9..72c82e9ef6d9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The deployment export result. */ -@Fluent +@Immutable public final class DeploymentExportResultInner implements JsonSerializable { /* * The template content. @@ -24,7 +24,7 @@ public final class DeploymentExportResultInner implements JsonSerializable tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -64,6 +80,55 @@ public DeploymentExtendedInner withProperties(DeploymentPropertiesExtended prope return this; } + /** + * Get the location property: the location of the deployment. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: the location of the deployment. + * + * @param location the location value to set. + * @return the DeploymentExtendedInner object itself. + */ + public DeploymentExtendedInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Deployment tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Deployment tags. + * + * @param tags the tags value to set. + * @return the DeploymentExtendedInner object itself. + */ + public DeploymentExtendedInner withTags(Map tags) { + this.tags = tags; + 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. * @@ -94,24 +159,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public DeploymentExtendedInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DeploymentExtendedInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Validates the instance. * @@ -129,9 +176,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -157,13 +204,15 @@ public static DeploymentExtendedInner fromJson(JsonReader jsonReader) throws IOE deserializedDeploymentExtendedInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDeploymentExtendedInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeploymentExtendedInner.properties = DeploymentPropertiesExtended.fromJson(reader); } else if ("location".equals(fieldName)) { - deserializedDeploymentExtendedInner.withLocation(reader.getString()); + deserializedDeploymentExtendedInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDeploymentExtendedInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedDeploymentExtendedInner.properties = DeploymentPropertiesExtended.fromJson(reader); + deserializedDeploymentExtendedInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedDeploymentExtendedInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java index 46792537f30d..e2f1c91e3de6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java index 28adea77c676..eb58fe8684f6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Deployment operation information. */ -@Fluent +@Immutable public final class DeploymentOperationInner implements JsonSerializable { /* * Full deployment operation ID. @@ -35,7 +35,7 @@ public final class DeploymentOperationInner implements JsonSerializable tags; + private String location; /* - * Deployment stack properties. + * Resource tags. */ - private DeploymentStackProperties innerProperties; + private Map tags; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -73,8 +73,17 @@ public DeploymentStackInner() { } /** - * Get the location property: The location of the Deployment stack. It cannot be changed after creation. It must be - * one of the supported Azure locations. + * Get the innerProperties property: Deployment stack properties. + * + * @return the innerProperties value. + */ + private DeploymentStackProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the location property: The geo-location where the resource lives. Required for subscription and management + * group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. * * @return the location value. */ @@ -83,8 +92,8 @@ public String location() { } /** - * Set the location property: The location of the Deployment stack. It cannot be changed after creation. It must be - * one of the supported Azure locations. + * Set the location property: The geo-location where the resource lives. Required for subscription and management + * group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. * * @param location the location value to set. * @return the DeploymentStackInner object itself. @@ -95,7 +104,7 @@ public DeploymentStackInner withLocation(String location) { } /** - * Get the tags property: Deployment stack resource tags. + * Get the tags property: Resource tags. * * @return the tags value. */ @@ -104,7 +113,7 @@ public Map tags() { } /** - * Set the tags property: Deployment stack resource tags. + * Set the tags property: Resource tags. * * @param tags the tags value to set. * @return the DeploymentStackInner object itself. @@ -114,21 +123,11 @@ public DeploymentStackInner withTags(Map tags) { return this; } - /** - * Get the innerProperties property: Deployment stack properties. - * - * @return the innerProperties value. - */ - private DeploymentStackProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } @@ -163,6 +162,15 @@ public String id() { return this.id; } + /** + * Get the error property: The error detail. + * + * @return the error value. + */ + public ManagementError error() { + return this.innerProperties() == null ? null : this.innerProperties().error(); + } + /** * Get the template property: The template content. You use this element when you want to pass the template syntax * directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. @@ -315,31 +323,6 @@ public DeploymentStackInner withDebugSetting(DeploymentStacksDebugSetting debugS return this; } - /** - * Get the bypassStackOutOfSyncError property: Flag to bypass service errors that indicate the stack resource list - * is not correctly synchronized. - * - * @return the bypassStackOutOfSyncError value. - */ - public Boolean bypassStackOutOfSyncError() { - return this.innerProperties() == null ? null : this.innerProperties().bypassStackOutOfSyncError(); - } - - /** - * Set the bypassStackOutOfSyncError property: Flag to bypass service errors that indicate the stack resource list - * is not correctly synchronized. - * - * @param bypassStackOutOfSyncError the bypassStackOutOfSyncError value to set. - * @return the DeploymentStackInner object itself. - */ - public DeploymentStackInner withBypassStackOutOfSyncError(Boolean bypassStackOutOfSyncError) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentStackProperties(); - } - this.innerProperties().withBypassStackOutOfSyncError(bypassStackOutOfSyncError); - return this; - } - /** * Get the deploymentScope property: The scope at which the initial deployment should be created. If a scope is not * specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: @@ -436,6 +419,31 @@ public String correlationId() { return this.innerProperties() == null ? null : this.innerProperties().correlationId(); } + /** + * Get the bypassStackOutOfSyncError property: Flag to bypass service errors that indicate the stack resource list + * is not correctly synchronized. + * + * @return the bypassStackOutOfSyncError value. + */ + public Boolean bypassStackOutOfSyncError() { + return this.innerProperties() == null ? null : this.innerProperties().bypassStackOutOfSyncError(); + } + + /** + * Set the bypassStackOutOfSyncError property: Flag to bypass service errors that indicate the stack resource list + * is not correctly synchronized. + * + * @param bypassStackOutOfSyncError the bypassStackOutOfSyncError value to set. + * @return the DeploymentStackInner object itself. + */ + public DeploymentStackInner withBypassStackOutOfSyncError(Boolean bypassStackOutOfSyncError) { + if (this.innerProperties() == null) { + this.innerProperties = new DeploymentStackProperties(); + } + this.innerProperties().withBypassStackOutOfSyncError(bypassStackOutOfSyncError); + return this; + } + /** * Get the detachedResources property: An array of resources that were detached during the most recent Deployment * stack update. Detached means that the resource was removed from the template, but no relevant deletion operations @@ -504,35 +512,11 @@ public String duration() { return this.innerProperties() == null ? null : this.innerProperties().duration(); } - /** - * Get the error property: The error detail. - * - * @return the error value. - */ - public ManagementError error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Set the error property: The error detail. - * - * @param error the error value to set. - * @return the DeploymentStackInner object itself. - */ - public DeploymentStackInner withError(ManagementError error) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentStackProperties(); - } - this.innerProperties().withError(error); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -545,9 +529,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeStringField("location", this.location); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -573,15 +557,15 @@ public static DeploymentStackInner fromJson(JsonReader jsonReader) throws IOExce deserializedDeploymentStackInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDeploymentStackInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDeploymentStackInner.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedDeploymentStackInner.innerProperties = DeploymentStackProperties.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedDeploymentStackInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedDeploymentStackInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDeploymentStackInner.innerProperties = DeploymentStackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDeploymentStackInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java index f52ab7e0393a..875146b3e9de 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -30,6 +30,11 @@ */ @Fluent public final class DeploymentStackProperties implements JsonSerializable { + /* + * The error detail. + */ + private ManagementError error; + /* * The template content. You use this element when you want to pass the template syntax directly in the request * rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the @@ -65,11 +70,6 @@ public final class DeploymentStackProperties implements JsonSerializable writer.writeJson(element)); jsonWriter.writeJsonField("parametersLink", this.parametersLink); jsonWriter.writeJsonField("debugSetting", this.debugSetting); - jsonWriter.writeBooleanField("bypassStackOutOfSyncError", this.bypassStackOutOfSyncError); jsonWriter.writeStringField("deploymentScope", this.deploymentScope); jsonWriter.writeStringField("description", this.description); - jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeBooleanField("bypassStackOutOfSyncError", this.bypassStackOutOfSyncError); return jsonWriter.writeEndObject(); } @@ -575,6 +563,8 @@ public static DeploymentStackProperties fromJson(JsonReader jsonReader) throws I deserializedDeploymentStackProperties.actionOnUnmanage = ActionOnUnmanage.fromJson(reader); } else if ("denySettings".equals(fieldName)) { deserializedDeploymentStackProperties.denySettings = DenySettings.fromJson(reader); + } else if ("error".equals(fieldName)) { + deserializedDeploymentStackProperties.error = ManagementError.fromJson(reader); } else if ("template".equals(fieldName)) { deserializedDeploymentStackProperties.template = reader.readUntyped(); } else if ("templateLink".equals(fieldName)) { @@ -588,9 +578,6 @@ public static DeploymentStackProperties fromJson(JsonReader jsonReader) throws I = DeploymentStacksParametersLink.fromJson(reader); } else if ("debugSetting".equals(fieldName)) { deserializedDeploymentStackProperties.debugSetting = DeploymentStacksDebugSetting.fromJson(reader); - } else if ("bypassStackOutOfSyncError".equals(fieldName)) { - deserializedDeploymentStackProperties.bypassStackOutOfSyncError - = reader.getNullable(JsonReader::getBoolean); } else if ("deploymentScope".equals(fieldName)) { deserializedDeploymentStackProperties.deploymentScope = reader.getString(); } else if ("description".equals(fieldName)) { @@ -600,6 +587,9 @@ public static DeploymentStackProperties fromJson(JsonReader jsonReader) throws I = DeploymentStackProvisioningState.fromString(reader.getString()); } else if ("correlationId".equals(fieldName)) { deserializedDeploymentStackProperties.correlationId = reader.getString(); + } else if ("bypassStackOutOfSyncError".equals(fieldName)) { + deserializedDeploymentStackProperties.bypassStackOutOfSyncError + = reader.getNullable(JsonReader::getBoolean); } else if ("detachedResources".equals(fieldName)) { List detachedResources = reader.readArray(reader1 -> ResourceReference.fromJson(reader1)); @@ -622,8 +612,6 @@ public static DeploymentStackProperties fromJson(JsonReader jsonReader) throws I deserializedDeploymentStackProperties.outputs = reader.readUntyped(); } else if ("duration".equals(fieldName)) { deserializedDeploymentStackProperties.duration = reader.getString(); - } else if ("error".equals(fieldName)) { - deserializedDeploymentStackProperties.error = ManagementError.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java index b83a2868a2ee..dabde9b3ab9e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Export Template specific properties of the Deployment stack. */ -@Fluent +@Immutable public final class DeploymentStackTemplateDefinitionInner implements JsonSerializable { /* @@ -33,7 +33,7 @@ public final class DeploymentStackTemplateDefinitionInner /** * Creates an instance of DeploymentStackTemplateDefinitionInner class. */ - public DeploymentStackTemplateDefinitionInner() { + private DeploymentStackTemplateDefinitionInner() { } /** @@ -47,19 +47,6 @@ public Object template() { return this.template; } - /** - * Set the template property: The template content. Use this element to pass the template syntax directly in the - * request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the - * templateLink property or the template property, but not both. - * - * @param template the template value to set. - * @return the DeploymentStackTemplateDefinitionInner object itself. - */ - public DeploymentStackTemplateDefinitionInner withTemplate(Object template) { - this.template = template; - return this; - } - /** * Get the templateLink property: The URI of the template. Use either the templateLink property or the template * property, but not both. @@ -70,18 +57,6 @@ public DeploymentStacksTemplateLink templateLink() { return this.templateLink; } - /** - * Set the templateLink property: The URI of the template. Use either the templateLink property or the template - * property, but not both. - * - * @param templateLink the templateLink value to set. - * @return the DeploymentStackTemplateDefinitionInner object itself. - */ - public DeploymentStackTemplateDefinitionInner withTemplateLink(DeploymentStacksTemplateLink templateLink) { - this.templateLink = templateLink; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java index cc5223f6055a..8d5225ac4f89 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java @@ -1,98 +1,85 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.resources.models.AzureResourceBase; import com.azure.resourcemanager.resources.models.DeploymentStackValidateProperties; import java.io.IOException; /** * The Deployment stack validation result. */ -@Fluent -public final class DeploymentStackValidateResultInner extends AzureResourceBase { +@Immutable +public final class DeploymentStackValidateResultInner implements JsonSerializable { /* - * The validation result details. + * String Id used to locate any resource on Azure. */ - private DeploymentStackValidateProperties properties; + private String id; /* - * The error detail. + * Name of this resource. */ - private ManagementError error; + private String name; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Type of this resource. */ - private SystemData systemData; + private String type; /* - * The type of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String type; + private SystemData systemData; /* - * The name of the resource. + * The error detail. */ - private String name; + private ManagementError error; /* - * Fully qualified resource Id for the resource. + * The validation result details. */ - private String id; + private DeploymentStackValidateProperties properties; /** * Creates an instance of DeploymentStackValidateResultInner class. */ - public DeploymentStackValidateResultInner() { + private DeploymentStackValidateResultInner() { } /** - * Get the properties property: The validation result details. - * - * @return the properties value. - */ - public DeploymentStackValidateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The validation result details. + * Get the id property: String Id used to locate any resource on Azure. * - * @param properties the properties value to set. - * @return the DeploymentStackValidateResultInner object itself. + * @return the id value. */ - public DeploymentStackValidateResultInner withProperties(DeploymentStackValidateProperties properties) { - this.properties = properties; - return this; + public String id() { + return this.id; } /** - * Get the error property: The error detail. + * Get the name property: Name of this resource. * - * @return the error value. + * @return the name value. */ - public ManagementError error() { - return this.error; + public String name() { + return this.name; } /** - * Set the error property: The error detail. + * Get the type property: Type of this resource. * - * @param error the error value to set. - * @return the DeploymentStackValidateResultInner object itself. + * @return the type value. */ - public DeploymentStackValidateResultInner withError(ManagementError error) { - this.error = error; - return this; + public String type() { + return this.type; } /** @@ -100,39 +87,26 @@ public DeploymentStackValidateResultInner withError(ManagementError error) { * * @return the systemData value. */ - @Override 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. + * Get the error property: The error detail. * - * @return the name value. + * @return the error value. */ - @Override - public String name() { - return this.name; + public ManagementError error() { + return this.error; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the properties property: The validation result details. * - * @return the id value. + * @return the properties value. */ - @Override - public String id() { - return this.id; + public DeploymentStackValidateProperties properties() { + return this.properties; } /** @@ -140,7 +114,6 @@ public String id() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (properties() != null) { properties().validate(); @@ -154,7 +127,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeJsonField("error", this.error); return jsonWriter.writeEndObject(); } @@ -164,7 +136,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DeploymentStackValidateResultInner 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 DeploymentStackValidateResultInner. */ public static DeploymentStackValidateResultInner fromJson(JsonReader jsonReader) throws IOException { @@ -183,11 +154,11 @@ public static DeploymentStackValidateResultInner fromJson(JsonReader jsonReader) deserializedDeploymentStackValidateResultInner.type = reader.getString(); } else if ("systemData".equals(fieldName)) { deserializedDeploymentStackValidateResultInner.systemData = SystemData.fromJson(reader); + } else if ("error".equals(fieldName)) { + deserializedDeploymentStackValidateResultInner.error = ManagementError.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedDeploymentStackValidateResultInner.properties = DeploymentStackValidateProperties.fromJson(reader); - } else if ("error".equals(fieldName)) { - deserializedDeploymentStackValidateResultInner.error = ManagementError.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java index 22544a71e8c9..2a5b7efcf391 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,7 +16,7 @@ /** * Information from validate template deployment response. */ -@Fluent +@Immutable public final class DeploymentValidateResultInner implements JsonSerializable { /* * The deployment validation error. @@ -46,7 +46,7 @@ public final class DeploymentValidateResultInner implements JsonSerializable tags) { - super.withTags(tags); - return this; - } - /** * Validates the instance. * @@ -228,10 +163,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("plan", plan()); if (properties() != null) { jsonWriter.writeUntypedField("properties", properties()); } + jsonWriter.writeJsonField("plan", plan()); jsonWriter.writeStringField("kind", kind()); jsonWriter.writeStringField("managedBy", managedBy()); jsonWriter.writeJsonField("sku", sku()); @@ -267,10 +202,10 @@ public static GenericResourceExpandedInner fromJson(JsonReader jsonReader) throw } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedGenericResourceExpandedInner.withTags(tags); - } else if ("plan".equals(fieldName)) { - deserializedGenericResourceExpandedInner.withPlan(Plan.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedGenericResourceExpandedInner.withProperties(reader.readUntyped()); + } else if ("plan".equals(fieldName)) { + deserializedGenericResourceExpandedInner.withPlan(Plan.fromJson(reader)); } else if ("kind".equals(fieldName)) { deserializedGenericResourceExpandedInner.withKind(reader.getString()); } else if ("managedBy".equals(fieldName)) { @@ -281,6 +216,8 @@ public static GenericResourceExpandedInner fromJson(JsonReader jsonReader) throw deserializedGenericResourceExpandedInner.withIdentity(Identity.fromJson(reader)); } else if ("extendedLocation".equals(fieldName)) { deserializedGenericResourceExpandedInner.withExtendedLocation(ExtendedLocation.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedGenericResourceExpandedInner.systemData = SystemData.fromJson(reader); } else if ("createdTime".equals(fieldName)) { deserializedGenericResourceExpandedInner.createdTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java index 8385ca5efedd..16e2a659841f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,14 +23,14 @@ @Fluent public class GenericResourceInner extends Resource { /* - * The plan of the resource. + * The resource-specific properties for this resource. */ - private Plan plan; + private Object properties; /* - * The resource properties. + * The plan of the resource. */ - private Object properties; + private Plan plan; /* * The kind of the resource. @@ -56,6 +57,11 @@ public class GenericResourceInner extends Resource { */ private ExtendedLocation extendedLocation; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -78,42 +84,42 @@ public GenericResourceInner() { } /** - * Get the plan property: The plan of the resource. + * Get the properties property: The resource-specific properties for this resource. * - * @return the plan value. + * @return the properties value. */ - public Plan plan() { - return this.plan; + public Object properties() { + return this.properties; } /** - * Set the plan property: The plan of the resource. + * Set the properties property: The resource-specific properties for this resource. * - * @param plan the plan value to set. + * @param properties the properties value to set. * @return the GenericResourceInner object itself. */ - public GenericResourceInner withPlan(Plan plan) { - this.plan = plan; + public GenericResourceInner withProperties(Object properties) { + this.properties = properties; return this; } /** - * Get the properties property: The resource properties. + * Get the plan property: The plan of the resource. * - * @return the properties value. + * @return the plan value. */ - public Object properties() { - return this.properties; + public Plan plan() { + return this.plan; } /** - * Set the properties property: The resource properties. + * Set the plan property: The plan of the resource. * - * @param properties the properties value to set. + * @param plan the plan value to set. * @return the GenericResourceInner object itself. */ - public GenericResourceInner withProperties(Object properties) { - this.properties = properties; + public GenericResourceInner withPlan(Plan plan) { + this.plan = plan; return this; } @@ -217,6 +223,26 @@ public GenericResourceInner withExtendedLocation(ExtendedLocation extendedLocati 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the GenericResourceInner object itself. + */ + GenericResourceInner withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the type property: The type of the resource. * @@ -293,10 +319,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("plan", this.plan); if (this.properties != null) { jsonWriter.writeUntypedField("properties", this.properties); } + jsonWriter.writeJsonField("plan", this.plan); jsonWriter.writeStringField("kind", this.kind); jsonWriter.writeStringField("managedBy", this.managedBy); jsonWriter.writeJsonField("sku", this.sku); @@ -332,10 +358,10 @@ public static GenericResourceInner fromJson(JsonReader jsonReader) throws IOExce } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedGenericResourceInner.withTags(tags); - } else if ("plan".equals(fieldName)) { - deserializedGenericResourceInner.plan = Plan.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedGenericResourceInner.properties = reader.readUntyped(); + } else if ("plan".equals(fieldName)) { + deserializedGenericResourceInner.plan = Plan.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedGenericResourceInner.kind = reader.getString(); } else if ("managedBy".equals(fieldName)) { @@ -346,6 +372,8 @@ public static GenericResourceInner fromJson(JsonReader jsonReader) throws IOExce deserializedGenericResourceInner.identity = Identity.fromJson(reader); } else if ("extendedLocation".equals(fieldName)) { deserializedGenericResourceInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGenericResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java index c346bef1be5a..18240d402245 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,7 +18,7 @@ /** * Location information. */ -@Fluent +@Immutable public final class LocationInner implements JsonSerializable { /* * The fully qualified ID of the location. For example, @@ -64,7 +64,7 @@ public final class LocationInner implements JsonSerializable { /** * Creates an instance of LocationInner class. */ - public LocationInner() { + private LocationInner() { } /** @@ -131,17 +131,6 @@ public LocationMetadata metadata() { return this.metadata; } - /** - * Set the metadata property: Metadata of the location, such as lat/long, paired region, and others. - * - * @param metadata the metadata value to set. - * @return the LocationInner object itself. - */ - public LocationInner withMetadata(LocationMetadata metadata) { - this.metadata = metadata; - return this; - } - /** * Get the availabilityZoneMappings property: The availability zone mappings for this region. * @@ -151,17 +140,6 @@ public List availabilityZoneMappings() { return this.availabilityZoneMappings; } - /** - * Set the availabilityZoneMappings property: The availability zone mappings for this region. - * - * @param availabilityZoneMappings the availabilityZoneMappings value to set. - * @return the LocationInner object itself. - */ - public LocationInner withAvailabilityZoneMappings(List availabilityZoneMappings) { - this.availabilityZoneMappings = availabilityZoneMappings; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java index c8f1e6191a3a..6c63ec2b3c06 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockObjectInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java index 8c677f21a0b3..b6e69f46c991 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ManagementLockProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java index 3c3798e29244..d06592435a69 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java @@ -1,40 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resources.models.ActionType; import com.azure.resourcemanager.resources.models.OperationDisplay; +import com.azure.resourcemanager.resources.models.Origin; import java.io.IOException; /** - * Microsoft.Resources operation. + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Operation name: {provider}/{resource}/{operation} + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * The object that represents the operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. */ private OperationDisplay display; + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -43,18 +66,17 @@ public String name() { } /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. * - * @param name the name value to set. - * @return the OperationInner object itself. + * @return the isDataAction value. */ - public OperationInner withName(String name) { - this.name = name; - return this; + public Boolean isDataAction() { + return this.isDataAction; } /** - * Get the display property: The object that represents the operation. + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -63,14 +85,23 @@ public OperationDisplay display() { } /** - * Set the display property: The object that represents the operation. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @param display the display value to set. - * @return the OperationInner object itself. + * @return the actionType value. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; + public ActionType actionType() { + return this.actionType; } /** @@ -90,7 +121,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); jsonWriter.writeJsonField("display", this.display); return jsonWriter.writeEndObject(); } @@ -112,8 +142,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java index 2df1da39adc9..f310811ace9f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -17,6 +17,7 @@ import com.azure.resourcemanager.resources.models.OverrideModel; import com.azure.resourcemanager.resources.models.ParameterValuesValue; import com.azure.resourcemanager.resources.models.ResourceSelector; +import com.azure.resourcemanager.resources.models.SelfServeExemptionSettings; import java.io.IOException; import java.util.List; import java.util.Map; @@ -42,7 +43,7 @@ public final class PolicyAssignmentInner extends ProxyResource { private Identity identity; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -117,7 +118,7 @@ public PolicyAssignmentInner withIdentity(Identity identity) { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -478,6 +479,29 @@ public String instanceId() { return this.innerProperties() == null ? null : this.innerProperties().instanceId(); } + /** + * Get the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @return the selfServeExemptionSettings value. + */ + public SelfServeExemptionSettings selfServeExemptionSettings() { + return this.innerProperties() == null ? null : this.innerProperties().selfServeExemptionSettings(); + } + + /** + * Set the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @param selfServeExemptionSettings the selfServeExemptionSettings value to set. + * @return the PolicyAssignmentInner object itself. + */ + public PolicyAssignmentInner withSelfServeExemptionSettings(SelfServeExemptionSettings selfServeExemptionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new PolicyAssignmentProperties(); + } + this.innerProperties().withSelfServeExemptionSettings(selfServeExemptionSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java index c618162b7eab..6bace9debda5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -15,6 +15,7 @@ import com.azure.resourcemanager.resources.models.OverrideModel; import com.azure.resourcemanager.resources.models.ParameterValuesValue; import com.azure.resourcemanager.resources.models.ResourceSelector; +import com.azure.resourcemanager.resources.models.SelfServeExemptionSettings; import java.io.IOException; import java.util.List; import java.util.Map; @@ -108,6 +109,11 @@ public final class PolicyAssignmentProperties implements JsonSerializable e.validate()); } + if (selfServeExemptionSettings() != null) { + selfServeExemptionSettings().validate(); + } } /** @@ -449,6 +479,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("assignmentType", this.assignmentType == null ? null : this.assignmentType.toString()); + jsonWriter.writeJsonField("selfServeExemptionSettings", this.selfServeExemptionSettings); return jsonWriter.writeEndObject(); } @@ -509,6 +540,9 @@ public static PolicyAssignmentProperties fromJson(JsonReader jsonReader) throws = AssignmentType.fromString(reader.getString()); } else if ("instanceId".equals(fieldName)) { deserializedPolicyAssignmentProperties.instanceId = reader.getString(); + } else if ("selfServeExemptionSettings".equals(fieldName)) { + deserializedPolicyAssignmentProperties.selfServeExemptionSettings + = SelfServeExemptionSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java index d626b336c197..174f4665b98c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.resources.models.OverrideModel; import com.azure.resourcemanager.resources.models.ResourceSelector; +import com.azure.resourcemanager.resources.models.SelfServeExemptionSettings; import java.io.IOException; import java.util.List; @@ -29,6 +30,11 @@ public final class PolicyAssignmentUpdateProperties implements JsonSerializable< */ private List overrides; + /* + * The self-serve exemption settings for the policy assignment. + */ + private SelfServeExemptionSettings selfServeExemptionSettings; + /** * Creates an instance of PolicyAssignmentUpdateProperties class. */ @@ -75,6 +81,27 @@ public PolicyAssignmentUpdateProperties withOverrides(List overri return this; } + /** + * Get the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @return the selfServeExemptionSettings value. + */ + public SelfServeExemptionSettings selfServeExemptionSettings() { + return this.selfServeExemptionSettings; + } + + /** + * Set the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @param selfServeExemptionSettings the selfServeExemptionSettings value to set. + * @return the PolicyAssignmentUpdateProperties object itself. + */ + public PolicyAssignmentUpdateProperties + withSelfServeExemptionSettings(SelfServeExemptionSettings selfServeExemptionSettings) { + this.selfServeExemptionSettings = selfServeExemptionSettings; + return this; + } + /** * Validates the instance. * @@ -87,6 +114,9 @@ public void validate() { if (overrides() != null) { overrides().forEach(e -> e.validate()); } + if (selfServeExemptionSettings() != null) { + selfServeExemptionSettings().validate(); + } } /** @@ -98,6 +128,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("resourceSelectors", this.resourceSelectors, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("selfServeExemptionSettings", this.selfServeExemptionSettings); return jsonWriter.writeEndObject(); } @@ -124,6 +155,9 @@ public static PolicyAssignmentUpdateProperties fromJson(JsonReader jsonReader) t } else if ("overrides".equals(fieldName)) { List overrides = reader.readArray(reader1 -> OverrideModel.fromJson(reader1)); deserializedPolicyAssignmentUpdateProperties.overrides = overrides; + } else if ("selfServeExemptionSettings".equals(fieldName)) { + deserializedPolicyAssignmentUpdateProperties.selfServeExemptionSettings + = SelfServeExemptionSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java index 5d194fdaa9fa..df03608e23c6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -28,7 +28,7 @@ public final class PolicyDefinitionInner extends ProxyResource { private PolicyDefinitionProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -63,7 +63,7 @@ private PolicyDefinitionProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java index 6304a5fa83f3..f7aebe4ea94f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionInner.java index b655a86d71ad..0c7faf9b56df 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -27,7 +27,7 @@ public final class PolicyDefinitionVersionInner extends ProxyResource { private PolicyDefinitionVersionProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -62,7 +62,7 @@ private PolicyDefinitionVersionProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionListResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionListResultInner.java index fa2b63a8214c..5f37a609cea0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionListResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionListResultInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,29 +14,29 @@ import java.util.List; /** - * List of policy definition versions. + * The response of a PolicyDefinitionVersion list operation. */ -@Fluent +@Immutable public final class PolicyDefinitionVersionListResultInner implements JsonSerializable { /* - * An array of policy definitions versions. + * The PolicyDefinitionVersion items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicyDefinitionVersionListResultInner class. */ - public PolicyDefinitionVersionListResultInner() { + private PolicyDefinitionVersionListResultInner() { } /** - * Get the value property: An array of policy definitions versions. + * Get the value property: The PolicyDefinitionVersion items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of policy definitions versions. - * - * @param value the value value to set. - * @return the PolicyDefinitionVersionListResultInner object itself. - */ - public PolicyDefinitionVersionListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyDefinitionVersionListResultInner object itself. - */ - public PolicyDefinitionVersionListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PolicyDefinitionVersionListResultInner")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PolicyDefinitionVersionListResultInner.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicyDefinitionVersionListResultInner 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 PolicyDefinitionVersionListResultInner. */ public static PolicyDefinitionVersionListResultInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionProperties.java index ac6c1ddc5116..6e3d3a6ab714 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java index e7a539d2b292..8f9b98ec2be5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java index ea294551196e..d6bd5b242a4f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java index 028b91e7c67e..841e31e1b58a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyExemptionUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java index c7325f229940..30b3108cf046 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -29,7 +29,7 @@ public final class PolicySetDefinitionInner extends ProxyResource { private PolicySetDefinitionProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -64,7 +64,7 @@ private PolicySetDefinitionProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java index 452470647082..b6fa899f4ea8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionInner.java index b7fe8cc06180..77a5b746ad1c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; @@ -29,7 +29,7 @@ public final class PolicySetDefinitionVersionInner extends ProxyResource { private PolicySetDefinitionVersionProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -64,7 +64,7 @@ private PolicySetDefinitionVersionProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionListResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionListResultInner.java index 6121552caf50..b783fbd7d2d3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionListResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionListResultInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -13,29 +14,29 @@ import java.util.List; /** - * List of policy set definition versions. + * The response of a PolicySetDefinitionVersion list operation. */ -@Fluent +@Immutable public final class PolicySetDefinitionVersionListResultInner implements JsonSerializable { /* - * An array of policy set definition versions. + * The PolicySetDefinitionVersion items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicySetDefinitionVersionListResultInner class. */ - public PolicySetDefinitionVersionListResultInner() { + private PolicySetDefinitionVersionListResultInner() { } /** - * Get the value property: An array of policy set definition versions. + * Get the value property: The PolicySetDefinitionVersion items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of policy set definition versions. - * - * @param value the value value to set. - * @return the PolicySetDefinitionVersionListResultInner object itself. - */ - public PolicySetDefinitionVersionListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicySetDefinitionVersionListResultInner object itself. - */ - public PolicySetDefinitionVersionListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PolicySetDefinitionVersionListResultInner")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PolicySetDefinitionVersionListResultInner.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicySetDefinitionVersionListResultInner 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 PolicySetDefinitionVersionListResultInner. */ public static PolicySetDefinitionVersionListResultInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionProperties.java index 6214ab6d7833..9a86a24273a6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyTokenResponseInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyTokenResponseInner.java index 9b661ad049a7..64e986d1bf93 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyTokenResponseInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyTokenResponseInner.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.resources.models.ExternalEvaluationEndpointInvocationResult; +import com.azure.resourcemanager.resources.models.PolicyTokenEvaluatedRequestDetails; import com.azure.resourcemanager.resources.models.PolicyTokenResult; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,13 +21,18 @@ /** * The policy token response properties. */ -@Fluent +@Immutable public final class PolicyTokenResponseInner implements JsonSerializable { /* * The result of the completed token acquisition operation. Possible values are Succeeded and Failed. */ private PolicyTokenResult result; + /* + * The external evaluation request details. + */ + private PolicyTokenEvaluatedRequestDetails requestDetails; + /* * Status message with additional details about the token acquisition operation result. */ @@ -65,7 +71,7 @@ public final class PolicyTokenResponseInner implements JsonSerializable results() { return this.results; } - /** - * Set the results property: An array of external evaluation endpoint invocation results. - * - * @param results the results value to set. - * @return the PolicyTokenResponseInner object itself. - */ - public PolicyTokenResponseInner withResults(List results) { - this.results = results; - return this; - } - /** * Get the changeReference property: The change reference associated with the operation for which the token is * acquired. @@ -162,18 +131,6 @@ public String changeReference() { return this.changeReference; } - /** - * Set the changeReference property: The change reference associated with the operation for which the token is - * acquired. - * - * @param changeReference the changeReference value to set. - * @return the PolicyTokenResponseInner object itself. - */ - public PolicyTokenResponseInner withChangeReference(String changeReference) { - this.changeReference = changeReference; - return this; - } - /** * Get the token property: The issued policy token. * @@ -183,17 +140,6 @@ public String token() { return this.token; } - /** - * Set the token property: The issued policy token. - * - * @param token the token value to set. - * @return the PolicyTokenResponseInner object itself. - */ - public PolicyTokenResponseInner withToken(String token) { - this.token = token; - return this; - } - /** * Get the tokenId property: The unique Id assigned to the policy token. * @@ -203,17 +149,6 @@ public String tokenId() { return this.tokenId; } - /** - * Set the tokenId property: The unique Id assigned to the policy token. - * - * @param tokenId the tokenId value to set. - * @return the PolicyTokenResponseInner object itself. - */ - public PolicyTokenResponseInner withTokenId(String tokenId) { - this.tokenId = tokenId; - return this; - } - /** * Get the expiration property: The expiration of the policy token. * @@ -223,23 +158,15 @@ public OffsetDateTime expiration() { return this.expiration; } - /** - * Set the expiration property: The expiration of the policy token. - * - * @param expiration the expiration value to set. - * @return the PolicyTokenResponseInner object itself. - */ - public PolicyTokenResponseInner withExpiration(OffsetDateTime expiration) { - this.expiration = expiration; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (requestDetails() != null) { + requestDetails().validate(); + } if (results() != null) { results().forEach(e -> e.validate()); } @@ -252,6 +179,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("result", this.result == null ? null : this.result.toString()); + jsonWriter.writeJsonField("requestDetails", this.requestDetails); jsonWriter.writeStringField("message", this.message); jsonWriter.writeStringField("retryAfter", this.retryAfter == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.retryAfter)); @@ -281,6 +209,9 @@ public static PolicyTokenResponseInner fromJson(JsonReader jsonReader) throws IO if ("result".equals(fieldName)) { deserializedPolicyTokenResponseInner.result = PolicyTokenResult.fromString(reader.getString()); + } else if ("requestDetails".equals(fieldName)) { + deserializedPolicyTokenResponseInner.requestDetails + = PolicyTokenEvaluatedRequestDetails.fromJson(reader); } else if ("message".equals(fieldName)) { deserializedPolicyTokenResponseInner.message = reader.getString(); } else if ("retryAfter".equals(fieldName)) { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java index db64afa5ce6c..fd024ceb5b7d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * Resource provider information. */ -@Fluent +@Immutable public final class ProviderInner implements JsonSerializable { /* * The provider ID. @@ -52,7 +52,7 @@ public final class ProviderInner implements JsonSerializable { /** * Creates an instance of ProviderInner class. */ - public ProviderInner() { + private ProviderInner() { } /** @@ -73,17 +73,6 @@ public String namespace() { return this.namespace; } - /** - * Set the namespace property: The namespace of the resource provider. - * - * @param namespace the namespace value to set. - * @return the ProviderInner object itself. - */ - public ProviderInner withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - /** * Get the registrationState property: The registration state of the resource provider. * @@ -120,18 +109,6 @@ public ProviderAuthorizationConsentState providerAuthorizationConsentState() { return this.providerAuthorizationConsentState; } - /** - * Set the providerAuthorizationConsentState property: The provider authorization consent state. - * - * @param providerAuthorizationConsentState the providerAuthorizationConsentState value to set. - * @return the ProviderInner object itself. - */ - public ProviderInner - withProviderAuthorizationConsentState(ProviderAuthorizationConsentState providerAuthorizationConsentState) { - this.providerAuthorizationConsentState = providerAuthorizationConsentState; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java index 430a6c05f0e3..0d826d3ad489 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * List of provider permissions. */ -@Fluent +@Immutable public final class ProviderPermissionListResultInner implements JsonSerializable { /* - * An array of provider permissions. + * The ProviderPermission items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ProviderPermissionListResultInner class. */ - public ProviderPermissionListResultInner() { + private ProviderPermissionListResultInner() { } /** - * Get the value property: An array of provider permissions. + * Get the value property: The ProviderPermission items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of provider permissions. - * - * @param value the value value to set. - * @return the ProviderPermissionListResultInner object itself. - */ - public ProviderPermissionListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ProviderPermissionListResultInner")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ProviderPermissionListResultInner.class); + /** * {@inheritDoc} */ @@ -81,6 +77,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProviderPermissionListResultInner 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 ProviderPermissionListResultInner. */ public static ProviderPermissionListResultInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java index 1ca79f7c7cac..80d3a30dd6ae 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,27 +17,27 @@ /** * List of resource types of a resource provider. */ -@Fluent +@Immutable public final class ProviderResourceTypeListResultInner implements JsonSerializable { /* - * An array of resource types. + * The ProviderResourceType items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ProviderResourceTypeListResultInner class. */ - public ProviderResourceTypeListResultInner() { + private ProviderResourceTypeListResultInner() { } /** - * Get the value property: An array of resource types. + * Get the value property: The ProviderResourceType items on this page. * * @return the value value. */ @@ -45,18 +46,7 @@ public List value() { } /** - * Set the value property: An array of resource types. - * - * @param value the value value to set. - * @return the ProviderResourceTypeListResultInner object itself. - */ - public ProviderResourceTypeListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -70,11 +60,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ProviderResourceTypeListResultInner")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ProviderResourceTypeListResultInner.class); + /** * {@inheritDoc} */ @@ -82,6 +78,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -91,6 +88,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProviderResourceTypeListResultInner 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 ProviderResourceTypeListResultInner. */ public static ProviderResourceTypeListResultInner fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java index 4bb9c7f4f3ea..7def77586586 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Resource group export result. */ -@Fluent +@Immutable public final class ResourceGroupExportResultInner implements JsonSerializable { /* * The template content. Used if outputFormat is empty or set to 'Json'. @@ -35,7 +35,7 @@ public final class ResourceGroupExportResultInner implements JsonSerializable { /* * The fully qualified ID for the subscription. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74 @@ -70,7 +70,7 @@ public final class SubscriptionInner implements JsonSerializable managedByTenants() { return this.managedByTenants; } - /** - * Set the managedByTenants property: An array containing the tenants managing the subscription. - * - * @param managedByTenants the managedByTenants value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withManagedByTenants(List managedByTenants) { - this.managedByTenants = managedByTenants; - return this; - } - /** * Get the tags property: The tags attached to the subscription. * @@ -191,17 +157,6 @@ public Map tags() { return this.tags; } - /** - * Set the tags property: The tags attached to the subscription. - * - * @param tags the tags value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java index 0a5cefe67e9f..782433e6b3c2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Tag details. */ -@Fluent +@Immutable public final class TagDetailsInner implements JsonSerializable { /* * The tag name ID. @@ -42,7 +42,7 @@ public final class TagDetailsInner implements JsonSerializable /** * Creates an instance of TagDetailsInner class. */ - public TagDetailsInner() { + private TagDetailsInner() { } /** @@ -63,17 +63,6 @@ public String tagName() { return this.tagName; } - /** - * Set the tagName property: The tag name. - * - * @param tagName the tagName value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withTagName(String tagName) { - this.tagName = tagName; - return this; - } - /** * Get the count property: The total number of resources that use the resource tag. When a tag is initially created * and has no associated resources, the value is 0. @@ -84,18 +73,6 @@ public TagCount count() { return this.count; } - /** - * Set the count property: The total number of resources that use the resource tag. When a tag is initially created - * and has no associated resources, the value is 0. - * - * @param count the count value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withCount(TagCount count) { - this.count = count; - return this; - } - /** * Get the values property: The list of tag values. * @@ -105,17 +82,6 @@ public List values() { return this.values; } - /** - * Set the values property: The list of tag values. - * - * @param values the values value to set. - * @return the TagDetailsInner object itself. - */ - public TagDetailsInner withValues(List values) { - this.values = values; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java index 3353e8f3c20b..e75d3c7453ba 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Tag information. */ -@Fluent +@Immutable public final class TagValueInner implements JsonSerializable { /* * The tag value ID. @@ -35,7 +35,7 @@ public final class TagValueInner implements JsonSerializable { /** * Creates an instance of TagValueInner class. */ - public TagValueInner() { + private TagValueInner() { } /** @@ -56,17 +56,6 @@ public String tagValue() { return this.tagValue; } - /** - * Set the tagValue property: The tag value. - * - * @param tagValue the tagValue value to set. - * @return the TagValueInner object itself. - */ - public TagValueInner withTagValue(String tagValue) { - this.tagValue = tagValue; - return this; - } - /** * Get the count property: The tag value count. * @@ -76,17 +65,6 @@ public TagCount count() { return this.count; } - /** - * Set the count property: The tag value count. - * - * @param count the count value to set. - * @return the TagValueInner object itself. - */ - public TagValueInner withCount(TagCount count) { - this.count = count; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java index e46cabc08a01..bb7e45e13868 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -23,6 +24,11 @@ public final class TagsResourceInner extends ProxyResource { */ private Tags properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -64,6 +70,15 @@ public TagsResourceInner withProperties(Tags 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. * @@ -144,6 +159,8 @@ public static TagsResourceInner fromJson(JsonReader jsonReader) throws IOExcepti deserializedTagsResourceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedTagsResourceInner.properties = Tags.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTagsResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java index c299bdd1d972..f103a57e7ac3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Result of the request to calculate template hash. It contains a string of minified template and its hash. */ -@Fluent +@Immutable public final class TemplateHashResultInner implements JsonSerializable { /* * The minified template string. @@ -29,7 +29,7 @@ public final class TemplateHashResultInner implements JsonSerializable { /* * List of resource changes predicted by What-If operation. @@ -37,7 +37,7 @@ public final class WhatIfOperationProperties implements JsonSerializable changes() { return this.changes; } - /** - * Set the changes property: List of resource changes predicted by What-If operation. - * - * @param changes the changes value to set. - * @return the WhatIfOperationProperties object itself. - */ - public WhatIfOperationProperties withChanges(List changes) { - this.changes = changes; - return this; - } - /** * Get the potentialChanges property: List of resource changes predicted by What-If operation. * @@ -69,17 +58,6 @@ public List potentialChanges() { return this.potentialChanges; } - /** - * Set the potentialChanges property: List of resource changes predicted by What-If operation. - * - * @param potentialChanges the potentialChanges value to set. - * @return the WhatIfOperationProperties object itself. - */ - public WhatIfOperationProperties withPotentialChanges(List potentialChanges) { - this.potentialChanges = potentialChanges; - return this; - } - /** * Get the diagnostics property: List of resource diagnostics detected by What-If operation. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java index 583df84a433c..4598ac2c5aeb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -19,7 +19,7 @@ * Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of * results. */ -@Fluent +@Immutable public final class WhatIfOperationResultInner implements JsonSerializable { /* * Status of the What-If operation. @@ -39,7 +39,7 @@ public final class WhatIfOperationResultInner implements JsonSerializable changes() { return this.innerProperties() == null ? null : this.innerProperties().changes(); } - /** - * Set the changes property: List of resource changes predicted by What-If operation. - * - * @param changes the changes value to set. - * @return the WhatIfOperationResultInner object itself. - */ - public WhatIfOperationResultInner withChanges(List changes) { - if (this.innerProperties() == null) { - this.innerProperties = new WhatIfOperationProperties(); - } - this.innerProperties().withChanges(changes); - return this; - } - /** * Get the potentialChanges property: List of resource changes predicted by What-If operation. * @@ -123,20 +87,6 @@ public List potentialChanges() { return this.innerProperties() == null ? null : this.innerProperties().potentialChanges(); } - /** - * Set the potentialChanges property: List of resource changes predicted by What-If operation. - * - * @param potentialChanges the potentialChanges value to set. - * @return the WhatIfOperationResultInner object itself. - */ - public WhatIfOperationResultInner withPotentialChanges(List potentialChanges) { - if (this.innerProperties() == null) { - this.innerProperties = new WhatIfOperationProperties(); - } - this.innerProperties().withPotentialChanges(potentialChanges); - return this; - } - /** * Get the diagnostics property: List of resource diagnostics detected by What-If operation. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java index 20fb92aad1d0..2c5ea2248248 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the inner data models for ResourceManagementClient. - * ResourceManagement Client. + * Provides operations for working with resources and resource groups. */ package com.azure.resourcemanager.resources.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java index a92cb1758bec..03e767508816 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the service clients for ResourceManagementClient. - * ResourceManagement Client. + * Provides operations for working with resources and resource groups. */ package com.azure.resourcemanager.resources.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java index b7afdc59ba13..4f2a0d181227 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/AuthorizationOperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java index 8d933ed1c623..a8884b9aeff9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientBuilder.java index e4587d03651d..3a142af8f35f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientImpl.java index 5b106dd77a2c..272ae449bb2a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ChangesManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesClientImpl.java index d61d26785c1b..5879f410254a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -57,151 +57,141 @@ public final class DataBoundariesClientImpl implements DataBoundariesClient { * The interface defining all the services for DataBoundariesManagementClientDataBoundaries to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "DataBoundariesManagementClientDataBoundaries") public interface DataBoundariesService { @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Resources/dataBoundaries/{default}") - @ExpectedResponses({ 200, 201 }) + @Get("/{scope}/providers/Microsoft.Resources/dataBoundaries/{default}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("default") DefaultName defaultParameter, - @BodyParam("application/json") DataBoundaryDefinitionInner dataBoundaryDefinition, - @HeaderParam("Accept") String accept, Context context); + Mono> getScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("default") DefaultName defaultParameter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Resources/dataBoundaries/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTenant(@HostParam("$host") String endpoint, + Mono> getTenant(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("default") DefaultName defaultParameter, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Resources/dataBoundaries/{default}") - @ExpectedResponses({ 200 }) + @Put("/providers/Microsoft.Resources/dataBoundaries/{default}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @PathParam("default") DefaultName defaultParameter, @HeaderParam("Accept") String accept, Context context); + Mono> put(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("default") DefaultName defaultParameter, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DataBoundaryDefinitionInner dataBoundaryDefinition, Context context); } /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. + * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putWithResponseAsync(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition) { + public Mono> getScopeWithResponseAsync(String scope, + DefaultName defaultParameter) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } if (defaultParameter == null) { return Mono .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } - if (dataBoundaryDefinition == null) { - return Mono.error( - new IllegalArgumentException("Parameter dataBoundaryDefinition is required and cannot be null.")); - } else { - dataBoundaryDefinition.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), - defaultParameter, dataBoundaryDefinition, accept, context)) + .withContext(context -> service.getScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + defaultParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. + * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition, Context context) { + private Mono> getScopeWithResponseAsync(String scope, + DefaultName defaultParameter, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } if (defaultParameter == null) { return Mono .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } - if (dataBoundaryDefinition == null) { - return Mono.error( - new IllegalArgumentException("Parameter dataBoundaryDefinition is required and cannot be null.")); - } else { - dataBoundaryDefinition.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), this.client.getApiVersion(), defaultParameter, - dataBoundaryDefinition, accept, context); + return service.getScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, defaultParameter, accept, + context); } /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition on successful completion of {@link Mono}. + * @return data boundary at specified scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition) { - return putWithResponseAsync(defaultParameter, dataBoundaryDefinition) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getScopeAsync(String scope, DefaultName defaultParameter) { + return getScopeWithResponseAsync(scope, defaultParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition along with {@link Response}. + * @return data boundary at specified scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition, Context context) { - return putWithResponseAsync(defaultParameter, dataBoundaryDefinition, context).block(); + public Response getScopeWithResponse(String scope, DefaultName defaultParameter, + Context context) { + return getScopeWithResponseAsync(scope, defaultParameter, context).block(); } /** - * Opt-in tenant to data boundary. + * Get data boundary at specified scope. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. - * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a data boundary definition. + * @return data boundary at specified scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoundaryDefinitionInner put(DefaultName defaultParameter, - DataBoundaryDefinitionInner dataBoundaryDefinition) { - return putWithResponse(defaultParameter, dataBoundaryDefinition, Context.NONE).getValue(); + public DataBoundaryDefinitionInner getScope(String scope, DefaultName defaultParameter) { + return getScopeWithResponse(scope, defaultParameter, Context.NONE).getValue(); } /** @@ -301,111 +291,122 @@ public DataBoundaryDefinitionInner getTenant(DefaultName defaultParameter) { } /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. + * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getScopeWithResponseAsync(String scope, - DefaultName defaultParameter) { + public Mono> putWithResponseAsync(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } if (defaultParameter == null) { return Mono .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } + if (dataBoundaryDefinition == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataBoundaryDefinition is required and cannot be null.")); + } else { + dataBoundaryDefinition.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - defaultParameter, accept, context)) + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), + defaultParameter, contentType, accept, dataBoundaryDefinition, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope along with {@link Response} on successful completion of {@link Mono}. + * @return a data boundary definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getScopeWithResponseAsync(String scope, - DefaultName defaultParameter, Context context) { + private Mono> putWithResponseAsync(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } if (defaultParameter == null) { return Mono .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); } + if (dataBoundaryDefinition == null) { + return Mono.error( + new IllegalArgumentException("Parameter dataBoundaryDefinition is required and cannot be null.")); + } else { + dataBoundaryDefinition.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), defaultParameter, accept, - context); + return service.put(this.client.getEndpoint(), this.client.getApiVersion(), defaultParameter, contentType, + accept, dataBoundaryDefinition, context); } /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope on successful completion of {@link Mono}. + * @return a data boundary definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getScopeAsync(String scope, DefaultName defaultParameter) { - return getScopeWithResponseAsync(scope, defaultParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono putAsync(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition) { + return putWithResponseAsync(defaultParameter, dataBoundaryDefinition) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope along with {@link Response}. + * @return a data boundary definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getScopeWithResponse(String scope, DefaultName defaultParameter, - Context context) { - return getScopeWithResponseAsync(scope, defaultParameter, context).block(); + public Response putWithResponse(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition, Context context) { + return putWithResponseAsync(defaultParameter, dataBoundaryDefinition, context).block(); } /** - * Get data boundary at specified scope. + * Opt-in tenant to data boundary. * - * @param scope The scope at which the operation is performed. * @param defaultParameter Default string modeled as parameter for auto generation to work correctly. + * @param dataBoundaryDefinition The data boundary to opt the tenant to. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data boundary at specified scope. + * @return a data boundary definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataBoundaryDefinitionInner getScope(String scope, DefaultName defaultParameter) { - return getScopeWithResponse(scope, defaultParameter, Context.NONE).getValue(); + public DataBoundaryDefinitionInner put(DefaultName defaultParameter, + DataBoundaryDefinitionInner dataBoundaryDefinition) { + return putWithResponse(defaultParameter, dataBoundaryDefinition, Context.NONE).getValue(); } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientBuilder.java index c0f6b4edb761..36c1dc94ddb6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { DataBoundariesManagementClientImpl.class }) public final class DataBoundariesManagementClientBuilder { /* - * server parameter + * Service host */ private String endpoint; /** - * Sets server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the DataBoundariesManagementClientBuilder. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientImpl.java index 8064b2330d70..136dcadf978b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,12 +20,12 @@ public final class DataBoundariesManagementClientImpl extends AzureServiceClient implements DataBoundariesManagementClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -34,12 +34,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -110,7 +110,7 @@ public DataBoundariesClient getDataBoundaries() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint server parameter. + * @param endpoint Service host. */ DataBoundariesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java index 794311f399bf..738d50958189 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.DataPolicyManifestsClient; import com.azure.resourcemanager.resources.fluent.models.DataPolicyManifestInner; -import com.azure.resourcemanager.resources.models.DataPolicyManifestListResult; +import com.azure.resourcemanager.resources.implementation.models.DataPolicyManifestListResult; import reactor.core.publisher.Mono; /** @@ -59,23 +59,23 @@ public final class DataPolicyManifestsClientImpl implements DataPolicyManifestsC * The interface defining all the services for PolicyClientDataPolicyManifests to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientDataPolicyManifests") public interface DataPolicyManifestsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/dataPolicyManifests/{policyMode}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByPolicyMode(@HostParam("$host") String endpoint, - @PathParam("policyMode") String policyMode, @QueryParam("api-version") String apiVersion, + Mono> getByPolicyMode(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("policyMode") String policyMode, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/dataPolicyManifests") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam(value = "$filter", encoded = true) String filter, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -83,7 +83,7 @@ Mono> list(@HostParam("$host") String end @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -107,11 +107,10 @@ public Mono> getByPolicyModeWithResponseAsync( if (policyMode == null) { return Mono.error(new IllegalArgumentException("Parameter policyMode is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByPolicyMode(this.client.getEndpoint(), policyMode, apiVersion, accept, context)) + .withContext(context -> service.getByPolicyMode(this.client.getEndpoint(), this.client.getApiVersion(), + policyMode, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -137,10 +136,10 @@ private Mono> getByPolicyModeWithResponseAsync if (policyMode == null) { return Mono.error(new IllegalArgumentException("Parameter policyMode is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByPolicyMode(this.client.getEndpoint(), policyMode, apiVersion, accept, context); + return service.getByPolicyMode(this.client.getEndpoint(), this.client.getApiVersion(), policyMode, accept, + context); } /** @@ -193,20 +192,21 @@ public DataPolicyManifestInner getByPolicyMode(String policyMode) { } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DataPolicyManifest list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter) { @@ -214,31 +214,31 @@ private Mono> listSinglePageAsync(String return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, filter, accept, context)) + return FluxUtil.withContext( + context -> service.list(this.client.getEndpoint(), 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())); } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DataPolicyManifest list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, Context context) { @@ -246,29 +246,28 @@ private Mono> listSinglePageAsync(String return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, filter, accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests as paginated response with {@link PagedFlux}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String filter) { @@ -276,16 +275,16 @@ public PagedFlux listAsync(String filter) { } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * * @throws 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 data policy manifests as paginated response with {@link PagedFlux}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { @@ -294,21 +293,21 @@ public PagedFlux listAsync() { } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests as paginated response with {@link PagedFlux}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { @@ -317,16 +316,16 @@ private PagedFlux listAsync(String filter, Context cont } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * * @throws 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 data policy manifests as paginated response with {@link PagedIterable}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -335,21 +334,21 @@ public PagedIterable list() { } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * This operation retrieves a list of all the data policy manifests that match the optional given $filter. Valid - * values for $filter are: "$filter=namespace eq '{0}'". If $filter is not provided, the unfiltered list includes + * values for $filter are: \"$filter=namespace eq '{0}'\". If $filter is not provided, the unfiltered list includes * all data policy manifests for data resource types. If $filter=namespace is provided, the returned list only * includes all data policy manifests that have a namespace matching the provided value. * - * @param filter The filter to apply on the operation. Valid values for $filter are: "namespace eq '{value}'". If + * @param filter The filter to apply on the operation. Valid values for $filter are: \"namespace eq '{value}'\". If * $filter is not provided, no filtering is performed. If $filter=namespace eq '{value}' is provided, the returned * list only includes all data policy manifests that have a namespace matching the provided value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests as paginated response with {@link PagedIterable}. + * @return the response of a DataPolicyManifest list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, Context context) { @@ -357,7 +356,7 @@ public PagedIterable list(String filter, Context contex } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * Get the next page of items. * @@ -365,7 +364,8 @@ public PagedIterable list(String filter, Context contex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 data policy manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DataPolicyManifest list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -384,7 +384,7 @@ private Mono> listNextSinglePageAsync(Str } /** - * Retrieves data policy manifests + * Retrieves data policy manifests. * * Get the next page of items. * @@ -393,7 +393,8 @@ private Mono> listNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of data policy manifests along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DataPolicyManifest list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java index 4b64ab928aa5..f7cccf8bafa2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.DeploymentOperationsClient; import com.azure.resourcemanager.resources.fluent.models.DeploymentOperationInner; -import com.azure.resourcemanager.resources.models.DeploymentOperationsListResult; +import com.azure.resourcemanager.resources.implementation.models.DeploymentOperationsListResult; import reactor.core.publisher.Mono; /** @@ -59,97 +59,96 @@ public final class DeploymentOperationsClientImpl implements DeploymentOperation * The interface defining all the services for DeploymentsManagementClientDeploymentOperations to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "DeploymentsManagementClientDeploymentOperations") public interface DeploymentOperationsService { @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + Mono> getAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + Mono> listAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, @PathParam("deploymentName") String deploymentName, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, + Mono> getAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScope(@HostParam("$host") String endpoint, + Mono> listAtManagementGroupScope( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, + Mono> getAtSubscriptionScope(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("$top") Integer top, + Mono> listAtSubscriptionScope(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deploymentName") String deploymentName, @PathParam("operationId") String operationId, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deploymentName") String deploymentName, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -157,7 +156,7 @@ Mono> listByResourceGroup(@HostParam("$ @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -165,7 +164,7 @@ Mono> listAtScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -173,7 +172,7 @@ Mono> listAtTenantScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtManagementGroupScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -181,7 +180,7 @@ Mono> listAtManagementGroupScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtSubscriptionScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -189,14 +188,14 @@ Mono> listAtSubscriptionScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -222,15 +221,15 @@ public Mono> getAtScopeWithResponseAsync(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtScope(this.client.getEndpoint(), scope, deploymentName, operationId, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param context The context to associate with this operation. @@ -257,14 +256,14 @@ private Mono> getAtScopeWithResponseAsync(Str } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtScope(this.client.getEndpoint(), scope, deploymentName, operationId, - this.client.getApiVersion(), accept, context); + return service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, + operationId, accept, context); } /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -281,7 +280,7 @@ public Mono getAtScopeAsync(String scope, String deplo /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @param context The context to associate with this operation. @@ -299,7 +298,7 @@ public Response getAtScopeWithResponse(String scope, S /** * Gets a deployments operation. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param operationId The ID of the operation to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -315,7 +314,7 @@ public DeploymentOperationInner getAtScope(String scope, String deploymentName, /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -339,8 +338,8 @@ private Mono> listAtScopeSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtScope(this.client.getEndpoint(), scope, deploymentName, top, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -349,7 +348,7 @@ private Mono> listAtScopeSinglePageAsync /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @param context The context to associate with this operation. @@ -375,7 +374,7 @@ private Mono> listAtScopeSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAtScope(this.client.getEndpoint(), scope, deploymentName, top, this.client.getApiVersion(), accept, + .listAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -384,7 +383,7 @@ private Mono> listAtScopeSinglePageAsync /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -401,7 +400,7 @@ public PagedFlux listAtScopeAsync(String scope, String /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -418,7 +417,7 @@ public PagedFlux listAtScopeAsync(String scope, String /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @param context The context to associate with this operation. @@ -437,7 +436,7 @@ private PagedFlux listAtScopeAsync(String scope, Strin /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -453,7 +452,7 @@ public PagedIterable listAtScope(String scope, String /** * Gets all deployments operations for a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param top The number of results to return. * @param context The context to associate with this operation. @@ -493,8 +492,8 @@ public Mono> getAtTenantScopeWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), deploymentName, operationId, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -524,8 +523,8 @@ private Mono> getAtTenantScopeWithResponseAsy } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtTenantScope(this.client.getEndpoint(), deploymentName, operationId, - this.client.getApiVersion(), accept, context); + return service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, + operationId, accept, context); } /** @@ -599,8 +598,8 @@ private Mono> listAtTenantScopeSinglePag } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtTenantScope(this.client.getEndpoint(), deploymentName, top, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -631,7 +630,7 @@ private Mono> listAtTenantScopeSinglePag final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAtTenantScope(this.client.getEndpoint(), deploymentName, top, this.client.getApiVersion(), accept, + .listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -748,8 +747,8 @@ public Mono> getAtManagementGroupScopeWithRes } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, operationId, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -783,8 +782,8 @@ private Mono> getAtManagementGroupScopeWithRe } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, operationId, - this.client.getApiVersion(), accept, context); + return service.getAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, operationId, accept, context); } /** @@ -867,8 +866,8 @@ private Mono> listAtManagementGroupScope } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, top, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -903,8 +902,8 @@ private Mono> listAtManagementGroupScope final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, top, - this.client.getApiVersion(), accept, context) + .listAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, deploymentName, + top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1014,20 +1013,21 @@ public Mono> getAtSubscriptionScopeWithRespon return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - operationId, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext( + context -> service.getAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1049,20 +1049,20 @@ private Mono> getAtSubscriptionScopeWithRespo return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (operationId == null) { return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtSubscriptionScope(this.client.getEndpoint(), deploymentName, operationId, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.getAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, operationId, accept, context); } /** @@ -1131,17 +1131,17 @@ private Mono> listAtSubscriptionScopeSin return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtSubscriptionScope(this.client.getEndpoint(), deploymentName, top, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1166,18 +1166,18 @@ private Mono> listAtSubscriptionScopeSin return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAtSubscriptionScope(this.client.getEndpoint(), deploymentName, top, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) + .listAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1298,8 +1298,8 @@ public Mono> getWithResponseAsync(String reso } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, deploymentName, - operationId, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + resourceGroupName, deploymentName, operationId, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1338,8 +1338,8 @@ private Mono> getWithResponseAsync(String res } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, deploymentName, operationId, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceGroupName, deploymentName, + operationId, this.client.getSubscriptionId(), accept, context); } /** @@ -1413,6 +1413,10 @@ private Mono> listByResourceGroupSingleP return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -1420,14 +1424,10 @@ private Mono> listByResourceGroupSingleP if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - deploymentName, top, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1453,6 +1453,10 @@ private Mono> listByResourceGroupSingleP return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -1460,15 +1464,11 @@ private Mono> listByResourceGroupSingleP if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, deploymentName, top, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksClientImpl.java index a8068b7591d4..26e42cafb6e0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -39,7 +39,7 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.DeploymentStackListResult; +import com.azure.resourcemanager.resources.implementation.models.DeploymentStackListResult; import com.azure.resourcemanager.resources.models.UnmanageActionManagementGroupMode; import com.azure.resourcemanager.resources.models.UnmanageActionResourceGroupMode; import com.azure.resourcemanager.resources.models.UnmanageActionResourceMode; @@ -77,190 +77,184 @@ public final class DeploymentStacksClientImpl implements InnerSupportsGet> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") + @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> validateStackAtResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdateAtResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("unmanageAction.Resources") UnmanageActionResourceMode unmanageActionResources, @QueryParam("unmanageAction.ResourceGroups") UnmanageActionResourceGroupMode unmanageActionResourceGroups, @QueryParam("unmanageAction.ManagementGroups") UnmanageActionManagementGroupMode unmanageActionManagementGroups, - @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") - @ExpectedResponses({ 200, 201 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtSubscription(@HostParam("$host") String endpoint, + Mono> exportTemplateAtResourceGroup( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscription(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getAtSubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtSubscription(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentStackName") String deploymentStackName, - @QueryParam("unmanageAction.Resources") UnmanageActionResourceMode unmanageActionResources, - @QueryParam("unmanageAction.ResourceGroups") UnmanageActionResourceGroupMode unmanageActionResourceGroups, - @QueryParam("unmanageAction.ManagementGroups") UnmanageActionManagementGroupMode unmanageActionManagementGroups, - @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") - @ExpectedResponses({ 200, 201 }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") + @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, - Context context); + Mono>> validateStackAtSubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdateAtSubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, + Mono>> deleteAtSubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("unmanageAction.Resources") UnmanageActionResourceMode unmanageActionResources, @QueryParam("unmanageAction.ResourceGroups") UnmanageActionResourceGroupMode unmanageActionResourceGroups, @QueryParam("unmanageAction.ManagementGroups") UnmanageActionManagementGroupMode unmanageActionManagementGroups, - @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtResourceGroup( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> exportTemplateAtSubscription( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtSubscription( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, + Mono> listAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") + @Post("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateStackAtResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, - Context context); + Mono>> validateStackAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") - @ExpectedResponses({ 200, 202, 400 }) + @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateStackAtSubscription(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, - Context context); + Mono>> createOrUpdateAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("deploymentStackName") String deploymentStackName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DeploymentStackInner deploymentStack, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("deploymentStackName") String deploymentStackName, + @QueryParam("unmanageAction.Resources") UnmanageActionResourceMode unmanageActionResources, + @QueryParam("unmanageAction.ResourceGroups") UnmanageActionResourceGroupMode unmanageActionResourceGroups, + @QueryParam("unmanageAction.ManagementGroups") UnmanageActionManagementGroupMode unmanageActionManagementGroups, + @QueryParam("bypassStackOutOfSyncError") Boolean bypassStackOutOfSyncError, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate") - @ExpectedResponses({ 200, 202, 400 }) + @Post("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/exportTemplate") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateStackAtManagementGroup(@HostParam("$host") String endpoint, + Mono> exportTemplateAtManagementGroup( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("deploymentStackName") String deploymentStackName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentStackInner deploymentStack, @HeaderParam("Accept") String accept, + @PathParam("deploymentStackName") String deploymentStackName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -268,7 +262,7 @@ Mono>> validateStackAtManagementGroup(@HostParam("$hos @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -276,7 +270,7 @@ Mono> listAtResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtSubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -284,21 +278,24 @@ Mono> listAtSubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -311,28 +308,32 @@ private Mono> listByResourceGroupSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -345,84 +346,76 @@ private Mono> listByResourceGroupSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, accept, context); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listAtResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String deploymentStackName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the Deployment stack with the given name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listAtResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String deploymentStackName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, context).block(); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Gets the Deployment stack with the given name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the Deployment stack with the given name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackInner getByResourceGroup(String resourceGroupName, String deploymentStackName) { + return getByResourceGroupWithResponse(resourceGroupName, deploymentStackName, Context.NONE).getValue(); } /** - * Lists all the Deployment stacks within the specified Resource Group. + * Lists Deployment stacks at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the Deployment stacks within the specified Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -431,26 +424,33 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -459,193 +459,347 @@ private Mono> listSinglePageAsync(Context co return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedFlux}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listAtSubscriptionNextSinglePageAsync(nextLink)); + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listAtResourceGroupNextSinglePageAsync(nextLink)); } /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedFlux}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listAtSubscriptionNextSinglePageAsync(nextLink, context)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listAtResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedIterable}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Lists all the Deployment stacks within the specified Subscription. + * Lists Deployment stacks at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks as paginated response with {@link PagedIterable}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupSinglePageAsync(String managementGroupId) { + public Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupId == null) { + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + if (deploymentStack == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); + } else { + deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtManagementGroup(this.client.getEndpoint(), managementGroupId, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.validateStackAtResourceGroup(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, + contentType, accept, deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupSinglePageAsync(String managementGroupId, - Context context) { + private Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack, 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) { + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + if (deploymentStack == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); + } else { + deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listAtManagementGroup(this.client.getEndpoint(), managementGroupId, this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.validateStackAtResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, contentType, accept, + deploymentStack, context); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupAsync(String managementGroupId) { - return new PagedFlux<>(() -> listAtManagementGroupSinglePageAsync(managementGroupId), - nextLink -> listAtManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack) { + Mono>> mono + = validateStackAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, deploymentStack); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, + DeploymentStackValidateResultInner.class, this.client.getContext()); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtManagementGroupAsync(String managementGroupId, Context context) { - return new PagedFlux<>(() -> listAtManagementGroupSinglePageAsync(managementGroupId, context), - nextLink -> listAtManagementGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = validateStackAtResourceGroupWithResponseAsync(resourceGroupName, + deploymentStackName, deploymentStack, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, + DeploymentStackValidateResultInner.class, context); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroup(String managementGroupId) { - return new PagedIterable<>(listAtManagementGroupAsync(managementGroupId)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack) { + return this.beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack) + .getSyncPoller(); } /** - * Lists all the Deployment stacks within the specified Management Group. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * - * @param managementGroupId Management Group id. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroup(String managementGroupId, Context context) { - return new PagedIterable<>(listAtManagementGroupAsync(managementGroupId, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + return this + .beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) + .getSyncPoller(); + } + + /** + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateStackAtResourceGroupAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack) { + return beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateStackAtResourceGroupAsync(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + return beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack) { + return validateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).block(); + } + + /** + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + return validateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) + .block(); } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -676,20 +830,21 @@ public Mono>> createOrUpdateAtResourceGroupWithRespons } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdateAtResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, this.client.getApiVersion(), - deploymentStack, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, + contentType, accept, deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -721,18 +876,20 @@ private Mono>> createOrUpdateAtResourceGroupWithRespon } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context); + return service.createOrUpdateAtResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, contentType, accept, + deploymentStack, context); } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -748,11 +905,11 @@ public PollerFlux, DeploymentStackInner> beginC } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -770,11 +927,11 @@ private PollerFlux, DeploymentStackInner> begin } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -788,11 +945,11 @@ public SyncPoller, DeploymentStackInner> beginC } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -808,11 +965,11 @@ public SyncPoller, DeploymentStackInner> beginC } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -826,11 +983,11 @@ public Mono createOrUpdateAtResourceGroupAsync(String reso } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -846,11 +1003,11 @@ private Mono createOrUpdateAtResourceGroupAsync(String res } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -863,11 +1020,11 @@ public DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupNa } /** - * Creates or updates a Deployment stack at Resource Group scope. + * Creates or updates a Deployment stack at the specified scope. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -882,19 +1039,26 @@ public DeploymentStackInner createOrUpdateAtResourceGroup(String resourceGroupNa } /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentStackName) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -911,29 +1075,36 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, deploymentStackName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentStackName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -950,245 +1121,105 @@ private Mono> getByResourceGroupWithResponseAsync return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentStackName, this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError, context); } /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String deploymentStackName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String deploymentStackName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName) { + final UnmanageActionResourceMode unmanageActionResources = null; + final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; + final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; + final Boolean bypassStackOutOfSyncError = null; + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets a Deployment stack with a given name at Resource Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Resource Group scope. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner getByResourceGroup(String resourceGroupName, String deploymentStackName) { - return getByResourceGroupWithResponse(resourceGroupName, deploymentStackName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError, this.client.getApiVersion(), accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned - * without content. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, - bypassStackOutOfSyncError, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned - * without content. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned - * without content. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName) { - final UnmanageActionResourceMode unmanageActionResources = null; - final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; - final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; - final Boolean bypassStackOutOfSyncError = null; - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned - * without content. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned - * without content. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentStackName) { @@ -1203,7 +1234,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1232,7 +1263,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1258,7 +1289,7 @@ public Mono deleteAsync(String resourceGroupName, String deploymentStackNa } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1280,7 +1311,7 @@ public Mono deleteAsync(String resourceGroupName, String deploymentStackNa } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1308,7 +1339,7 @@ private Mono deleteAsync(String resourceGroupName, String deploymentStackN } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1328,7 +1359,7 @@ public void delete(String resourceGroupName, String deploymentStackName) { } /** - * Deletes a Deployment stack by name at Resource Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1354,18 +1385,19 @@ public void delete(String resourceGroupName, String deploymentStackName, } /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack) { + public Mono> + exportTemplateAtResourceGroupWithResponseAsync(String resourceGroupName, String deploymentStackName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1374,38 +1406,37 @@ public Mono>> createOrUpdateAtSubscriptionWithResponse return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (deploymentStackName == null) { + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (deploymentStack == null) { + if (deploymentStackName == null) { return Mono - .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); - } else { - deploymentStack.validate(); + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtSubscription(this.client.getEndpoint(), - this.client.getSubscriptionId(), deploymentStackName, this.client.getApiVersion(), deploymentStack, - accept, context)) + .withContext( + context -> service.exportTemplateAtResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { + private Mono> exportTemplateAtResourceGroupWithResponseAsync( + String resourceGroupName, String deploymentStackName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1414,176 +1445,187 @@ private Mono>> createOrUpdateAtSubscriptionWithRespons return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (deploymentStackName == null) { + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (deploymentStack == null) { + if (deploymentStackName == null) { return Mono - .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); - } else { - deploymentStack.validate(); + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), - deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context); + return service.exportTemplateAtResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, accept, context); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment stack object. + * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentStackInner> - beginCreateOrUpdateAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack) { - Mono>> mono - = createOrUpdateAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentStackInner.class, DeploymentStackInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportTemplateAtResourceGroupAsync(String resourceGroupName, + String deploymentStackName) { + return exportTemplateAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment stack object. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtSubscriptionAsync( - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentStackInner.class, DeploymentStackInner.class, context); - } - - /** - * Creates or updates a Deployment stack at Subscription scope. - * - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 deployment stack object. + * @return export Template specific properties of the Deployment stack along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackInner> - beginCreateOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack) { - return this.beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtResourceGroupWithResponse( + String resourceGroupName, String deploymentStackName, Context context) { + return exportTemplateAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, context).block(); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Exports the template used to create the Deployment stack at the specified scope. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment stack object. + * @return export Template specific properties of the Deployment stack. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtSubscription( - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return this.beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(String resourceGroupName, + String deploymentStackName) { + return exportTemplateAtResourceGroupWithResponse(resourceGroupName, deploymentStackName, Context.NONE) + .getValue(); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object on successful completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack) { - return beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object on successful completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - return beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, accept, context); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, - DeploymentStackInner deploymentStack) { - return createOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).block(); + public Mono getAtSubscriptionAsync(String deploymentStackName) { + return getAtSubscriptionWithResponseAsync(deploymentStackName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment stack object. + * @return the Deployment stack with the given name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - return createOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context).block(); + public Response getAtSubscriptionWithResponse(String deploymentStackName, Context context) { + return getAtSubscriptionWithResponseAsync(deploymentStackName, context).block(); } /** - * Gets a Deployment stack with a given name at Subscription scope. + * Gets the Deployment stack with the given name. * * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope along with {@link Response} on successful + * @return the Deployment stack with the given name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackInner getAtSubscription(String deploymentStackName) { + return getAtSubscriptionWithResponse(deploymentStackName, Context.NONE).getValue(); + } + + /** + * Lists Deployment stacks at the specified scope. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1592,31 +1634,27 @@ public Mono> getAtSubscriptionWithResponseAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtSubscription(this.client.getEndpoint(), - this.client.getSubscriptionId(), deploymentStackName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope along with {@link Response} on successful + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtSubscriptionWithResponseAsync(String deploymentStackName, - Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1625,79 +1663,84 @@ private Mono> getAtSubscriptionWithResponseAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), - deploymentStackName, this.client.getApiVersion(), accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtSubscriptionAsync(String deploymentStackName) { - return getAtSubscriptionWithResponseAsync(deploymentStackName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listAtSubscriptionNextSinglePageAsync(nextLink)); } /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope along with {@link Response}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtSubscriptionWithResponse(String deploymentStackName, Context context) { - return getAtSubscriptionWithResponseAsync(deploymentStackName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listAtSubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Gets a Deployment stack with a given name at Subscription scope. + * Lists Deployment stacks at the specified scope. * - * @param deploymentStackName Name of the deployment stack. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists Deployment stacks at the specified scope. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Subscription scope. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner getAtSubscription(String deploymentStackName) { - return getAtSubscriptionWithResponse(deploymentStackName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + public Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1710,35 +1753,37 @@ public Mono>> deleteAtSubscriptionWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } + if (deploymentStack == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); + } else { + deploymentStack.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteAtSubscription(this.client.getEndpoint(), - this.client.getSubscriptionId(), deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError, this.client.getApiVersion(), accept, context)) + return FluxUtil + .withContext(context -> service.validateStackAtSubscription(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentStackName, contentType, accept, + deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the Deployment stack validation result along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { + private Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1751,280 +1796,193 @@ private Mono>> deleteAtSubscriptionWithResponseAsync(S return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } + if (deploymentStack == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); + } else { + deploymentStack.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), - deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, - bypassStackOutOfSyncError, this.client.getApiVersion(), accept, context); + return service.validateStackAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, contentType, accept, deploymentStack, context); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + public PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack) { Mono>> mono - = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = validateStackAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, + DeploymentStackValidateResultInner.class, this.client.getContext()); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName) { - final UnmanageActionResourceMode unmanageActionResources = null; - final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; - final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; - final Boolean bypassStackOutOfSyncError = null; + private PollerFlux, DeploymentStackValidateResultInner> + beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack, + Context context) { + context = this.client.mergeContext(context); Mono>> mono - = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = validateStackAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, + DeploymentStackValidateResultInner.class, context); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @param context The context to associate with this operation. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack) { + return this.beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).getSyncPoller(); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName) { - final UnmanageActionResourceMode unmanageActionResources = null; - final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; - final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; - final Boolean bypassStackOutOfSyncError = null; - return this - .beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError) + public SyncPoller, DeploymentStackValidateResultInner> + beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, + Context context) { + return this.beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context) .getSyncPoller(); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. - * - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - return this - .beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError, context) - .getSyncPoller(); - } - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. - * - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtSubscriptionAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtSubscriptionAsync(String deploymentStackName) { - final UnmanageActionResourceMode unmanageActionResources = null; - final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; - final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; - final Boolean bypassStackOutOfSyncError = null; - return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono validateStackAtSubscriptionAsync(String deploymentStackName, + DeploymentStackInner deploymentStack) { + return beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtSubscriptionAsync(String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono validateStackAtSubscriptionAsync(String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + return beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscription(String deploymentStackName) { - final UnmanageActionResourceMode unmanageActionResources = null; - final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; - final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; - final Boolean bypassStackOutOfSyncError = null; - deleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError).block(); + public DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner deploymentStack) { + return validateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).block(); } /** - * Deletes a Deployment stack by name at Subscription scope. When operation completes, status code 200 returned - * without content. + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to + * Azure Resource Manager. * * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscription(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - Context context) { - deleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError, context).block(); + public DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + return validateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context).block(); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack) { + public Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack) { 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 (deploymentStackName == null) { return Mono @@ -2036,19 +1994,20 @@ public Mono>> createOrUpdateAtManagementGroupWithRespo } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), - managementGroupId, deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context)) + .withContext(context -> service.createOrUpdateAtSubscription(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentStackName, contentType, accept, + deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2056,15 +2015,15 @@ public Mono>> createOrUpdateAtManagementGroupWithRespo * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + private Mono>> createOrUpdateAtSubscriptionWithResponseAsync(String deploymentStackName, + DeploymentStackInner deploymentStack, 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 (deploymentStackName == null) { return Mono @@ -2076,38 +2035,37 @@ private Mono>> createOrUpdateAtManagementGroupWithResp } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupId, - deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context); + return service.createOrUpdateAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, contentType, accept, deploymentStack, context); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtManagementGroupAsync( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { + public PollerFlux, DeploymentStackInner> + beginCreateOrUpdateAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack) { Mono>> mono - = createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, deploymentStack); + = createOrUpdateAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DeploymentStackInner.class, DeploymentStackInner.class, this.client.getContext()); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2115,40 +2073,36 @@ public PollerFlux, DeploymentStackInner> beginC * @return the {@link PollerFlux} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentStackInner> - beginCreateOrUpdateAtManagementGroupAsync(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { + private PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtSubscriptionAsync( + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, - deploymentStackName, deploymentStack, context); + Mono>> mono + = createOrUpdateAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DeploymentStackInner.class, DeploymentStackInner.class, context); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { - return this.beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack) - .getSyncPoller(); + public SyncPoller, DeploymentStackInner> + beginCreateOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack) { + return this.beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).getSyncPoller(); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2156,37 +2110,34 @@ public SyncPoller, DeploymentStackInner> beginC * @return the {@link SyncPoller} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( - String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return this - .beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) + public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtSubscription( + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + return this.beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context) .getSyncPoller(); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack) { - return beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).last() + public Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, + DeploymentStackInner deploymentStack) { + return beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2194,35 +2145,33 @@ public Mono createOrUpdateAtManagementGroupAsync(String ma * @return deployment stack object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAtSubscriptionAsync(String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + return beginCreateOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, + public DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack) { - return createOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).block(); + return createOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack).block(); } /** - * Creates or updates a Deployment stack at Management Group scope. + * Creates or updates a Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack supplied to the operation. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2230,266 +2179,144 @@ public DeploymentStackInner createOrUpdateAtManagementGroup(String managementGro * @return deployment stack object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, + public DeploymentStackInner createOrUpdateAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return createOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) - .block(); + return createOrUpdateAtSubscriptionAsync(deploymentStackName, deploymentStack, context).block(); } /** - * Gets a Deployment stack with a given name at Management Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName) { + public Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { 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 (deploymentStackName == null) { return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, - deploymentStackName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a Deployment stack with a given name at Management Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, Context context) { + private Mono>> deleteAtSubscriptionWithResponseAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + 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 (deploymentStackName == null) { return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, deploymentStackName, - this.client.getApiVersion(), accept, context); + return service.deleteAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError, context); } /** - * Gets a Deployment stack with a given name at Management Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupAsync(String managementGroupId, String deploymentStackName) { - return getAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + Mono>> mono + = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets a Deployment stack with a given name at Management Group scope. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupWithResponse(String managementGroupId, - String deploymentStackName, Context context) { - return getAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, context).block(); - } - - /** - * Gets a Deployment stack with a given name at Management Group scope. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Deployment stack with a given name at Management Group scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackInner getAtManagementGroup(String managementGroupId, String deploymentStackName) { - return getAtManagementGroupWithResponse(managementGroupId, deploymentStackName, Context.NONE).getValue(); - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned - * without content. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - 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 (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), - managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, - unmanageActionManagementGroups, bypassStackOutOfSyncError, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned - * without content. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, - 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 (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupId, deploymentStackName, - unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, - bypassStackOutOfSyncError, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned - * without content. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. - * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. - * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. - * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not - * correctly synchronized. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, - UnmanageActionResourceGroupMode unmanageActionResourceGroups, - UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - Mono>> mono - = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned - * without content. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, - String deploymentStackName) { + public PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName) { final UnmanageActionResourceMode unmanageActionResources = null; final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; final Boolean bypassStackOutOfSyncError = null; Mono>> mono - = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, + = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -2503,24 +2330,23 @@ public PollerFlux, Void> beginDeleteAtManagementGroupAsync(Stri * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + private PollerFlux, Void> beginDeleteAtSubscriptionAsync(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context) { context = this.client.mergeContext(context); Mono>> mono - = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, + = deleteAtSubscriptionWithResponseAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2528,23 +2354,21 @@ private PollerFlux, Void> beginDeleteAtManagementGroupAsync(Str * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, - String deploymentStackName) { + public SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName) { final UnmanageActionResourceMode unmanageActionResources = null; final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; final Boolean bypassStackOutOfSyncError = null; return this - .beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError) + .beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError) .getSyncPoller(); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -2558,22 +2382,21 @@ public SyncPoller, Void> beginDeleteAtManagementGroup(String ma * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, - String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + public SyncPoller, Void> beginDeleteAtSubscription(String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context) { return this - .beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context) + .beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError, context) .getSyncPoller(); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -2586,20 +2409,19 @@ public SyncPoller, Void> beginDeleteAtManagementGroup(String ma * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + public Mono deleteAtSubscriptionAsync(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { - return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2607,21 +2429,20 @@ public Mono deleteAtManagementGroupAsync(String managementGroupId, String * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName) { + public Mono deleteAtSubscriptionAsync(String deploymentStackName) { final UnmanageActionResourceMode unmanageActionResources = null; final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; final Boolean bypassStackOutOfSyncError = null; - return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -2635,41 +2456,39 @@ public Mono deleteAtManagementGroupAsync(String managementGroupId, String * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + private Mono deleteAtSubscriptionAsync(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context) { - return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + return beginDeleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String managementGroupId, String deploymentStackName) { + public void deleteAtSubscription(String deploymentStackName) { final UnmanageActionResourceMode unmanageActionResources = null; final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; final Boolean bypassStackOutOfSyncError = null; - deleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).block(); + deleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError).block(); } /** - * Deletes a Deployment stack by name at Management Group scope. When operation completes, status code 200 returned + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned * without content. * - * @param managementGroupId Management Group id. * @param deploymentStackName Name of the deployment stack. * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. @@ -2682,19 +2501,17 @@ public void deleteAtManagementGroup(String managementGroupId, String deploymentS * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String managementGroupId, String deploymentStackName, - UnmanageActionResourceMode unmanageActionResources, + public void deleteAtSubscription(String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, UnmanageActionResourceGroupMode unmanageActionResourceGroups, UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, Context context) { - deleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, - unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context).block(); + deleteAtSubscriptionAsync(deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError, context).block(); } /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2704,7 +2521,7 @@ public void deleteAtManagementGroup(String managementGroupId, String deploymentS */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> - exportTemplateAtResourceGroupWithResponseAsync(String resourceGroupName, String deploymentStackName) { + exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2713,26 +2530,20 @@ public void deleteAtManagementGroup(String managementGroupId, String deploymentS return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (deploymentStackName == null) { return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.exportTemplateAtSubscription(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentStackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2742,8 +2553,8 @@ public void deleteAtManagementGroup(String managementGroupId, String deploymentS * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtResourceGroupWithResponseAsync( - String resourceGroupName, String deploymentStackName, Context context) { + private Mono> + exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2752,24 +2563,19 @@ private Mono> exportTemplateAtR return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (deploymentStackName == null) { return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, deploymentStackName, this.client.getApiVersion(), accept, context); + return service.exportTemplateAtSubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentStackName, accept, context); } /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2777,16 +2583,14 @@ private Mono> exportTemplateAtR * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtResourceGroupAsync(String resourceGroupName, - String deploymentStackName) { - return exportTemplateAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName) + public Mono exportTemplateAtSubscriptionAsync(String deploymentStackName) { + return exportTemplateAtSubscriptionWithResponseAsync(deploymentStackName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2795,15 +2599,14 @@ public Mono exportTemplateAtResourceGrou * @return export Template specific properties of the Deployment stack along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtResourceGroupWithResponse( - String resourceGroupName, String deploymentStackName, Context context) { - return exportTemplateAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, context).block(); + public Response + exportTemplateAtSubscriptionWithResponse(String deploymentStackName, Context context) { + return exportTemplateAtSubscriptionWithResponseAsync(deploymentStackName, context).block(); } /** - * Exports the template used to create the Deployment stack at Resource Group scope. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2811,32 +2614,31 @@ public Response exportTemplateAtResource * @return export Template specific properties of the Deployment stack. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(String resourceGroupName, - String deploymentStackName) { - return exportTemplateAtResourceGroupWithResponse(resourceGroupName, deploymentStackName, Context.NONE) - .getValue(); + public DeploymentStackTemplateDefinitionInner exportTemplateAtSubscription(String deploymentStackName) { + return exportTemplateAtSubscriptionWithResponse(deploymentStackName, Context.NONE).getValue(); } /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack along with {@link Response} on successful - * completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName) { + public Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -2844,32 +2646,33 @@ public DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(Stri } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtSubscription(this.client.getEndpoint(), - this.client.getSubscriptionId(), deploymentStackName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, deploymentStackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack along with {@link Response} on successful - * completion of {@link Mono}. + * @return the Deployment stack with the given name along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - exportTemplateAtSubscriptionWithResponseAsync(String deploymentStackName, Context context) { + private Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -2877,69 +2680,70 @@ public DeploymentStackTemplateDefinitionInner exportTemplateAtResourceGroup(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), - deploymentStackName, this.client.getApiVersion(), accept, context); + return service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, + deploymentStackName, accept, context); } /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. + * @return the Deployment stack with the given name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtSubscriptionAsync(String deploymentStackName) { - return exportTemplateAtSubscriptionWithResponseAsync(deploymentStackName) + public Mono getAtManagementGroupAsync(String managementGroupId, String deploymentStackName) { + return getAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack along with {@link Response}. + * @return the Deployment stack with the given name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - exportTemplateAtSubscriptionWithResponse(String deploymentStackName, Context context) { - return exportTemplateAtSubscriptionWithResponseAsync(deploymentStackName, context).block(); + public Response getAtManagementGroupWithResponse(String managementGroupId, + String deploymentStackName, Context context) { + return getAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, context).block(); } /** - * Exports the template used to create the Deployment stack at Subscription scope. + * Gets the Deployment stack with the given name. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return export Template specific properties of the Deployment stack. + * @return the Deployment stack with the given name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackTemplateDefinitionInner exportTemplateAtSubscription(String deploymentStackName) { - return exportTemplateAtSubscriptionWithResponse(deploymentStackName, Context.NONE).getValue(); + public DeploymentStackInner getAtManagementGroup(String managementGroupId, String deploymentStackName) { + return getAtManagementGroupWithResponse(managementGroupId, deploymentStackName, Context.NONE).getValue(); } /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack along with {@link Response} on successful + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - exportTemplateAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName) { + private Mono> listAtManagementGroupSinglePageAsync(String managementGroupId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2948,32 +2752,29 @@ public DeploymentStackTemplateDefinitionInner exportTemplateAtSubscription(Strin return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtManagementGroup(this.client.getEndpoint(), - managementGroupId, deploymentStackName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, 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())); } /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack along with {@link Response} on successful + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtManagementGroupWithResponseAsync( - String managementGroupId, String deploymentStackName, Context context) { + private Mono> listAtManagementGroupSinglePageAsync(String managementGroupId, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2982,75 +2783,82 @@ private Mono> exportTemplateAtM return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - if (deploymentStackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtManagementGroup(this.client.getEndpoint(), managementGroupId, - deploymentStackName, this.client.getApiVersion(), accept, context); + return service + .listAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtManagementGroupAsync(String managementGroupId, - String deploymentStackName) { - return exportTemplateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtManagementGroupAsync(String managementGroupId) { + return new PagedFlux<>(() -> listAtManagementGroupSinglePageAsync(managementGroupId), + nextLink -> listAtManagementGroupNextSinglePageAsync(nextLink)); } /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack along with {@link Response}. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtManagementGroupWithResponse( - String managementGroupId, String deploymentStackName, Context context) { - return exportTemplateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupAsync(String managementGroupId, Context context) { + return new PagedFlux<>(() -> listAtManagementGroupSinglePageAsync(managementGroupId, context), + nextLink -> listAtManagementGroupNextSinglePageAsync(nextLink, context)); } /** - * Exports the template used to create the Deployment stack at Management Group scope. + * Lists Deployment stacks at the specified scope. * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. + * @param managementGroupId The management group 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 export Template specific properties of the Deployment stack. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(String managementGroupId, - String deploymentStackName) { - return exportTemplateAtManagementGroupWithResponse(managementGroupId, deploymentStackName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroup(String managementGroupId) { + return new PagedIterable<>(listAtManagementGroupAsync(managementGroupId)); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Lists Deployment stacks at the specified scope. + * + * @param managementGroupId The management group ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a DeploymentStack list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroup(String managementGroupId, Context context) { + return new PagedIterable<>(listAtManagementGroupAsync(managementGroupId, context)); + } + + /** + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3058,19 +2866,15 @@ public DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(St * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + public Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { + if (managementGroupId == null) { return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -3082,21 +2886,22 @@ public Mono>> validateStackAtResourceGroupWithResponse } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateStackAtResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, deploymentStackName, this.client.getApiVersion(), - deploymentStack, accept, context)) + .withContext(context -> service.validateStackAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, deploymentStackName, contentType, accept, + deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3105,19 +2910,15 @@ public Mono>> validateStackAtResourceGroupWithResponse * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateStackAtResourceGroupWithResponseAsync(String resourceGroupName, + private Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { + if (managementGroupId == null) { return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -3129,19 +2930,20 @@ private Mono>> validateStackAtResourceGroupWithRespons } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateStackAtResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context); + return service.validateStackAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, deploymentStackName, contentType, accept, deploymentStack, context); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3149,22 +2951,22 @@ private Mono>> validateStackAtResourceGroupWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { Mono>> mono - = validateStackAtResourceGroupWithResponseAsync(resourceGroupName, deploymentStackName, deploymentStack); + = validateStackAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, deploymentStack); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, DeploymentStackValidateResultInner.class, this.client.getContext()); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3173,10 +2975,10 @@ private Mono>> validateStackAtResourceGroupWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroupAsync(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { context = this.client.mergeContext(context); - Mono>> mono = validateStackAtResourceGroupWithResponseAsync(resourceGroupName, + Mono>> mono = validateStackAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, deploymentStack, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, @@ -3184,12 +2986,12 @@ private Mono>> validateStackAtResourceGroupWithRespons } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -3197,19 +2999,19 @@ private Mono>> validateStackAtResourceGroupWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { - return this.beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack) + return this.beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack) .getSyncPoller(); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3218,39 +3020,39 @@ private Mono>> validateStackAtResourceGroupWithRespons */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtResourceGroup(String resourceGroupName, String deploymentStackName, + beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { return this - .beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) + .beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) .getSyncPoller(); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateStackAtResourceGroupAsync(String resourceGroupName, + public Mono validateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { - return beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).last() + return beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3258,38 +3060,37 @@ public Mono validateStackAtResourceGroupAsyn * @return the Deployment stack validation result on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateStackAtResourceGroupAsync(String resourceGroupName, + private Mono validateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return beginValidateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + return beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + public DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { - return validateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack).block(); + return validateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).block(); } /** - * Runs preflight validation on the Resource Group scoped Deployment stack template to verify its acceptance to + * Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to * Azure Resource Manager. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack The content of the action request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3297,34 +3098,33 @@ public DeploymentStackValidateResultInner validateStackAtResourceGroup(String re * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtResourceGroup(String resourceGroupName, + public DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return validateStackAtResourceGroupAsync(resourceGroupName, deploymentStackName, deploymentStack, context) + return validateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) .block(); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack) { + public Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -3336,37 +3136,37 @@ public Mono>> validateStackAtSubscriptionWithResponseA } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateStackAtSubscription(this.client.getEndpoint(), - this.client.getSubscriptionId(), deploymentStackName, this.client.getApiVersion(), deploymentStack, - accept, context)) + .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, deploymentStackName, contentType, accept, + deploymentStack, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return deployment stack object along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateStackAtSubscriptionWithResponseAsync(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { + private Mono>> createOrUpdateAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } if (deploymentStackName == null) { return Mono @@ -3378,182 +3178,521 @@ private Mono>> validateStackAtSubscriptionWithResponse } else { deploymentStack.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateStackAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), - deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context); + return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, deploymentStackName, contentType, accept, deploymentStack, context); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the Deployment stack validation result. + * @return the {@link PollerFlux} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack) { + public PollerFlux, DeploymentStackInner> beginCreateOrUpdateAtManagementGroupAsync( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { Mono>> mono - = validateStackAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, - DeploymentStackValidateResultInner.class, this.client.getContext()); + = createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, deploymentStack); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeploymentStackInner.class, DeploymentStackInner.class, this.client.getContext()); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Creates or updates a Deployment stack at the specified scope. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param deploymentStack Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the Deployment stack validation result. + * @return the {@link PollerFlux} for polling of deployment stack object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtSubscriptionAsync(String deploymentStackName, DeploymentStackInner deploymentStack, - Context context) { + private PollerFlux, DeploymentStackInner> + beginCreateOrUpdateAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, + deploymentStackName, deploymentStack, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeploymentStackInner.class, DeploymentStackInner.class, context); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment stack object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack) { + return this.beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack) + .getSyncPoller(); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment stack object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentStackInner> beginCreateOrUpdateAtManagementGroup( + String managementGroupId, String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + return this + .beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) + .getSyncPoller(); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment stack object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack) { + return beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment stack object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + return beginCreateOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment stack object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, + DeploymentStackInner deploymentStack) { + return createOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).block(); + } + + /** + * Creates or updates a Deployment stack at the specified scope. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param deploymentStack Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment stack object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStackInner createOrUpdateAtManagementGroup(String managementGroupId, String deploymentStackName, + DeploymentStackInner deploymentStack, Context context) { + return createOrUpdateAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) + .block(); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + 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 (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + 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 (deploymentStackName == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, deploymentStackName, unmanageActionResources, unmanageActionResourceGroups, + unmanageActionManagementGroups, bypassStackOutOfSyncError, context); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { Mono>> mono - = validateStackAtSubscriptionWithResponseAsync(deploymentStackName, deploymentStack, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, - DeploymentStackValidateResultInner.class, context); + = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Deployment stack validation result. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack) { - return this.beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).getSyncPoller(); + public PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, + String deploymentStackName) { + final UnmanageActionResourceMode unmanageActionResources = null; + final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; + final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; + final Boolean bypassStackOutOfSyncError = null; + Mono>> mono + = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAtManagementGroupAsync(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, + String deploymentStackName) { + final UnmanageActionResourceMode unmanageActionResources = null; + final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; + final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; + final Boolean bypassStackOutOfSyncError = null; + return this + .beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError) + .getSyncPoller(); + } + + /** + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. + * + * @param managementGroupId The management group ID. + * @param deploymentStackName Name of the deployment stack. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtManagementGroup(String managementGroupId, + String deploymentStackName, UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { + return this + .beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context) + .getSyncPoller(); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param context The context to associate with this operation. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 Deployment stack validation result. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtSubscription(String deploymentStackName, DeploymentStackInner deploymentStack, - Context context) { - return this.beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError) { + return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateStackAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack) { - return beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName) { + final UnmanageActionResourceMode unmanageActionResources = null; + final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; + final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; + final Boolean bypassStackOutOfSyncError = null; + return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateStackAtSubscriptionAsync(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - return beginValidateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAtManagementGroupAsync(String managementGroupId, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { + return beginDeleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, - DeploymentStackInner deploymentStack) { - return validateStackAtSubscriptionAsync(deploymentStackName, deploymentStack).block(); + public void deleteAtManagementGroup(String managementGroupId, String deploymentStackName) { + final UnmanageActionResourceMode unmanageActionResources = null; + final UnmanageActionResourceGroupMode unmanageActionResourceGroups = null; + final UnmanageActionManagementGroupMode unmanageActionManagementGroups = null; + final Boolean bypassStackOutOfSyncError = null; + deleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError).block(); } /** - * Runs preflight validation on the Subscription scoped Deployment stack template to verify its acceptance to Azure - * Resource Manager. + * Deletes a Deployment stack by name at the specified scope. When operation completes, status code 200 returned + * without content. * + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. + * @param unmanageActionResources Flag to indicate delete rather than detach for unmanaged resources. + * @param unmanageActionResourceGroups Flag to indicate delete rather than detach for unmanaged resource groups. + * @param unmanageActionManagementGroups Flag to indicate delete rather than detach for unmanaged management groups. + * @param bypassStackOutOfSyncError Flag to bypass service errors that indicate the stack resource list is not + * correctly synchronized. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtSubscription(String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - return validateStackAtSubscriptionAsync(deploymentStackName, deploymentStack, context).block(); + public void deleteAtManagementGroup(String managementGroupId, String deploymentStackName, + UnmanageActionResourceMode unmanageActionResources, + UnmanageActionResourceGroupMode unmanageActionResourceGroups, + UnmanageActionManagementGroupMode unmanageActionManagementGroups, Boolean bypassStackOutOfSyncError, + Context context) { + deleteAtManagementGroupAsync(managementGroupId, deploymentStackName, unmanageActionResources, + unmanageActionResourceGroups, unmanageActionManagementGroups, bypassStackOutOfSyncError, context).block(); } /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack) { + public Mono> + exportTemplateAtManagementGroupWithResponseAsync(String managementGroupId, String deploymentStackName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3566,36 +3705,28 @@ public Mono>> validateStackAtManagementGroupWithRespon return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - if (deploymentStack == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); - } else { - deploymentStack.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateStackAtManagementGroup(this.client.getEndpoint(), managementGroupId, - deploymentStackName, this.client.getApiVersion(), deploymentStack, accept, context)) + .withContext(context -> service.exportTemplateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, deploymentStackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result along with {@link Response} on successful completion of - * {@link Mono}. + * @return export Template specific properties of the Deployment stack along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateStackAtManagementGroupWithResponseAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { + private Mono> exportTemplateAtManagementGroupWithResponseAsync( + String managementGroupId, String deploymentStackName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3608,183 +3739,62 @@ private Mono>> validateStackAtManagementGroupWithRespo return Mono .error(new IllegalArgumentException("Parameter deploymentStackName is required and cannot be null.")); } - if (deploymentStack == null) { - return Mono - .error(new IllegalArgumentException("Parameter deploymentStack is required and cannot be null.")); - } else { - deploymentStack.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateStackAtManagementGroup(this.client.getEndpoint(), managementGroupId, deploymentStackName, - this.client.getApiVersion(), deploymentStack, accept, context); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Deployment stack validation result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack) { - Mono>> mono - = validateStackAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, deploymentStack); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, - DeploymentStackValidateResultInner.class, this.client.getContext()); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Deployment stack validation result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroupAsync(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = validateStackAtManagementGroupWithResponseAsync(managementGroupId, - deploymentStackName, deploymentStack, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentStackValidateResultInner.class, - DeploymentStackValidateResultInner.class, context); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Deployment stack validation result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack) { - return this.beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack) - .getSyncPoller(); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Deployment stack validation result. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentStackValidateResultInner> - beginValidateStackAtManagementGroup(String managementGroupId, String deploymentStackName, - DeploymentStackInner deploymentStack, Context context) { - return this - .beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) - .getSyncPoller(); + return service.exportTemplateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, deploymentStackName, accept, context); } /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. + * @return export Template specific properties of the Deployment stack on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateStackAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack) { - return beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono exportTemplateAtManagementGroupAsync(String managementGroupId, + String deploymentStackName) { + return exportTemplateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateStackAtManagementGroupAsync(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return beginValidateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. - * - * @param managementGroupId Management Group id. - * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. + * @return export Template specific properties of the Deployment stack along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack) { - return validateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack).block(); + public Response exportTemplateAtManagementGroupWithResponse( + String managementGroupId, String deploymentStackName, Context context) { + return exportTemplateAtManagementGroupWithResponseAsync(managementGroupId, deploymentStackName, context) + .block(); } /** - * Runs preflight validation on the Management Group scoped Deployment stack template to verify its acceptance to - * Azure Resource Manager. + * Exports the template used to create the Deployment stack at the specified scope. * - * @param managementGroupId Management Group id. + * @param managementGroupId The management group ID. * @param deploymentStackName Name of the deployment stack. - * @param deploymentStack Deployment stack to validate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Deployment stack validation result. + * @return export Template specific properties of the Deployment stack. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentStackValidateResultInner validateStackAtManagementGroup(String managementGroupId, - String deploymentStackName, DeploymentStackInner deploymentStack, Context context) { - return validateStackAtManagementGroupAsync(managementGroupId, deploymentStackName, deploymentStack, context) - .block(); + public DeploymentStackTemplateDefinitionInner exportTemplateAtManagementGroup(String managementGroupId, + String deploymentStackName) { + return exportTemplateAtManagementGroupWithResponse(managementGroupId, deploymentStackName, Context.NONE) + .getValue(); } /** @@ -3794,7 +3804,8 @@ public DeploymentStackValidateResultInner validateStackAtManagementGroup(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtResourceGroupNextSinglePageAsync(String nextLink) { @@ -3822,7 +3833,8 @@ private Mono> listAtResourceGroupNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtResourceGroupNextSinglePageAsync(String nextLink, @@ -3848,7 +3860,8 @@ private Mono> listAtResourceGroupNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtSubscriptionNextSinglePageAsync(String nextLink) { @@ -3876,7 +3889,8 @@ private Mono> listAtSubscriptionNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtSubscriptionNextSinglePageAsync(String nextLink, @@ -3902,7 +3916,8 @@ private Mono> listAtSubscriptionNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtManagementGroupNextSinglePageAsync(String nextLink) { @@ -3930,7 +3945,8 @@ private Mono> listAtManagementGroupNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Deployment stacks along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a DeploymentStack list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAtManagementGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientBuilder.java index 0628600a5703..7ba499f46612 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { DeploymentStacksManagementClientImpl.class }) public final class DeploymentStacksManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the DeploymentStacksManagementClientBuilder. */ - public DeploymentStacksManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public DeploymentStacksManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the DeploymentStacksManagementClientBuilder. */ - public DeploymentStacksManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public DeploymentStacksManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public DeploymentStacksManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DeploymentStacksManagementClientImpl client = new DeploymentStacksManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientImpl.java index 23e39332c601..a1f30d38e316 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,26 +20,12 @@ public final class DeploymentStacksManagementClientImpl extends AzureServiceClient implements DeploymentStacksManagementClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -48,12 +34,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -61,6 +47,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -124,17 +124,17 @@ public DeploymentStacksClient getDeploymentStacks() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ DeploymentStacksManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2024-03-01"; this.deploymentStacks = new DeploymentStacksClientImpl(this); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java index 8f8e02b58e1e..e5492ed1fdd6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -43,7 +43,7 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.DeploymentListResult; +import com.azure.resourcemanager.resources.implementation.models.DeploymentListResult; import com.azure.resourcemanager.resources.models.DeploymentWhatIf; import com.azure.resourcemanager.resources.models.ScopedDeployment; import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf; @@ -81,216 +81,214 @@ public final class DeploymentsClientImpl implements InnerSupportsGet>> deleteAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> getAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> checkExistenceAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + Mono>> createOrUpdateAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, Context context); + @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @Get("/{scope}/providers/Microsoft.Resources/deployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> cancelAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + Mono>> validateAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); @Headers({ "Content-Type: application/json" }) @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> exportTemplateAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Resources/deployments/") + @Get("/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + Mono> getAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> checkExistenceAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, @HeaderParam("Accept") String accept, - Context context); + Mono>> createOrUpdateAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScopedDeployment parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono>> deleteAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> cancelAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeployment parameters, @HeaderParam("Accept") String accept, - Context context); + Mono>> validateAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScopedDeployment parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeploymentWhatIf parameters, @HeaderParam("Accept") String accept, - Context context); + Mono>> whatIfAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ScopedDeploymentWhatIf parameters, Context context); @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplateAtTenantScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + Mono> exportTemplateAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Resources/deployments/") + @Get("/providers/Microsoft.Resources/deployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) + @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> checkExistenceAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, Context context); + Mono>> createOrUpdateAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScopedDeployment parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> cancelAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScopedDeployment parameters, - @HeaderParam("Accept") String accept, Context context); + Mono>> validateAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScopedDeployment parameters, + Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ScopedDeploymentWhatIf parameters, @HeaderParam("Accept") String accept, + Mono>> whatIfAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ScopedDeploymentWhatIf parameters, Context context); @Headers({ "Content-Type: application/json" }) @@ -298,78 +296,76 @@ Mono>> whatIfAtManagementGroupScope(@HostParam("$host" @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> exportTemplateAtManagementGroupScope( - @HostParam("$host") String endpoint, @PathParam("groupId") String groupId, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtManagementGroupScope(@HostParam("$host") String endpoint, - @PathParam("groupId") String groupId, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> getAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> checkExistenceAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + Mono>> createOrUpdateAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, Context context); + @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> cancelAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + Mono>> validateAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIfAtSubscriptionScope(@HostParam("$host") String endpoint, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentWhatIf parameters, @HeaderParam("Accept") String accept, + Mono>> whatIfAtSubscriptionScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentWhatIf parameters, Context context); @Headers({ "Content-Type: application/json" }) @@ -377,120 +373,107 @@ Mono>> whatIfAtSubscriptionScope(@HostParam("$host") S @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> exportTemplateAtSubscriptionScope( - @HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/") + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence(@HostParam("$host") String endpoint, + Mono> checkExistence(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancel(@HostParam("$host") String endpoint, + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") @ExpectedResponses({ 200, 202, 400 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validate(@HostParam("$host") String endpoint, + Mono>> validate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> whatIf(@HostParam("$host") String endpoint, + Mono>> whatIf(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DeploymentWhatIf parameters, @HeaderParam("Accept") String accept, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentWhatIf parameters, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> exportTemplate(@HostParam("$host") String endpoint, + Mono> exportTemplate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/calculateTemplateHash") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculateTemplateHash(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Object template, - @HeaderParam("Accept") String accept, Context context); + Mono> calculateTemplateHash(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") Object template, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -498,7 +481,7 @@ Mono> listAtScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -506,7 +489,7 @@ Mono> listAtTenantScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtManagementGroupScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -514,7 +497,7 @@ Mono> listAtManagementGroupScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAtSubscriptionScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -522,29 +505,22 @@ Mono> listAtSubscriptionScopeNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName) { + public Mono> getAtScopeWithResponseAsync(String scope, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -557,31 +533,24 @@ public Mono>> deleteAtScopeWithResponseAsync(String sc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName, + private Mono> getAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -595,230 +564,91 @@ private Mono>> deleteAtScopeWithResponseAsync(String s } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), - accept, context); + return service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, accept, + context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName) { - Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAtScopeAsync(String scope, String deploymentName) { + return getAtScopeWithResponseAsync(scope, deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtScopeWithResponse(String scope, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return getAtScopeWithResponseAsync(scope, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName) { - return this.beginDeleteAtScopeAsync(scope, deploymentName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getAtScope(String scope, String deploymentName) { + return getAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context) { - return this.beginDeleteAtScopeAsync(scope, deploymentName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.checkExistenceAtScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, deploymentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtScopeAsync(String scope, String deploymentName) { - return beginDeleteAtScopeAsync(scope, deploymentName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtScopeAsync(String scope, String deploymentName, Context context) { - return beginDeleteAtScopeAsync(scope, deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope, String deploymentName) { - deleteAtScopeAsync(scope, deploymentName).block(); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope, String deploymentName, Context context) { - deleteAtScopeAsync(scope, deploymentName, context).block(); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkExistenceAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether the deployment exists. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -837,16 +667,15 @@ private Mono> checkExistenceAtScopeWithResponseAsync(String sc if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistenceAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context); + return service.checkExistenceAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, context); } /** * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -862,7 +691,7 @@ public Mono checkExistenceAtScopeAsync(String scope, String deploymentN /** * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -878,7 +707,7 @@ public Response checkExistenceAtScopeWithResponse(String scope, String /** * Checks whether the deployment exists. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -895,7 +724,7 @@ public boolean checkExistenceAtScope(String scope, String deploymentName) { * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -921,10 +750,11 @@ public Mono>> createOrUpdateAtScopeWithResponseAsync(S } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdateAtScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -933,7 +763,7 @@ public Mono>> createOrUpdateAtScopeWithResponseAsync(S * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -960,10 +790,11 @@ private Mono>> createOrUpdateAtScopeWithResponseAsync( } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, contentType, accept, parameters, context); } /** @@ -971,7 +802,7 @@ private Mono>> createOrUpdateAtScopeWithResponseAsync( * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -994,7 +825,7 @@ private Mono>> createOrUpdateAtScopeWithResponseAsync( * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -1018,7 +849,7 @@ private PollerFlux, DeploymentExtendedInner> * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1037,7 +868,7 @@ private PollerFlux, DeploymentExtendedInner> * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -1057,7 +888,7 @@ private PollerFlux, DeploymentExtendedInner> * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1077,7 +908,7 @@ public Mono createOrUpdateAtScopeAsync(String scope, St * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -1098,7 +929,7 @@ private Mono createOrUpdateAtScopeAsync(String scope, S * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1117,7 +948,7 @@ public DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploy * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. @@ -1133,17 +964,24 @@ public DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploy } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtScopeWithResponseAsync(String scope, String deploymentName) { + public Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1154,26 +992,32 @@ public Mono> getAtScopeWithResponseAsync(Strin if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtScopeWithResponseAsync(String scope, String deploymentName, + private Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1185,198 +1029,212 @@ private Mono> getAtScopeWithResponseAsync(Stri if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, + return service.deleteAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, context); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtScopeAsync(String scope, String deploymentName) { - return getAtScopeWithResponseAsync(scope, deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName) { + Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtScopeWithResponse(String scope, String deploymentName, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName, Context context) { - return getAtScopeWithResponseAsync(scope, deploymentName, context).block(); + context = this.client.mergeContext(context); + Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtScope(String scope, String deploymentName) { - return getAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName) { + return this.beginDeleteAtScopeAsync(scope, deploymentName).getSyncPoller(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtScope(String scope, String deploymentName, Context context) { + return this.beginDeleteAtScopeAsync(scope, deploymentName, context).getSyncPoller(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), - accept, context); + public Mono deleteAtScopeAsync(String scope, String deploymentName) { + return beginDeleteAtScopeAsync(scope, deploymentName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Cancels a currently running template deployment. - * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * Deletes a deployment from the deployment history. * - * @param scope The resource scope. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtScopeAsync(String scope, String deploymentName) { - return cancelAtScopeWithResponseAsync(scope, deploymentName).flatMap(ignored -> Mono.empty()); + private Mono deleteAtScopeAsync(String scope, String deploymentName, Context context) { + return beginDeleteAtScopeAsync(scope, deploymentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context) { - return cancelAtScopeWithResponseAsync(scope, deploymentName, context).block(); + public void deleteAtScope(String scope, String deploymentName) { + deleteAtScopeAsync(scope, deploymentName).block(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtScope(String scope, String deploymentName) { - cancelAtScopeWithResponse(scope, deploymentName, Context.NONE); + public void deleteAtScope(String scope, String deploymentName, Context context) { + deleteAtScopeAsync(scope, deploymentName, context).block(); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response along with {@link Response} on successful - * completion of {@link Mono}. + * @return all the deployments at the given scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, - DeploymentInner parameters) { + private Mono> listAtScopeSinglePageAsync(String scope, String filter, + Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1384,38 +1242,32 @@ public Mono>> validateAtScopeWithResponseAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.listAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response along with {@link Response} on successful - * completion of {@link Mono}. + * @return all the deployments at the given scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, - DeploymentInner parameters, Context context) { + private Mono> listAtScopeSinglePageAsync(String scope, String filter, + Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1423,222 +1275,153 @@ private Mono>> validateAtScopeWithResponseAsync(String if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), - parameters, accept, context); - } - - /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 information from validate template deployment response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters) { - Mono>> mono = validateAtScopeWithResponseAsync(scope, deploymentName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, - this.client.getContext()); + return service + .listAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, filter, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = validateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtScopeAsync(String scope, String filter, Integer top) { + return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top), + nextLink -> listAtScopeNextSinglePageAsync(nextLink)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of information from validate template deployment response. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters) { - return this.beginValidateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtScopeAsync(String scope) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top), + nextLink -> listAtScopeNextSinglePageAsync(nextLink)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context) { - return this.beginValidateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync(String scope, String filter, Integer top, + Context context) { + return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top, context), + nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response on successful completion of {@link Mono}. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtScopeAsync(String scope, String deploymentName, - DeploymentInner parameters) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope(String scope) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAtScopeAsync(scope, filter, top)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments at the given scope. * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response on successful completion of {@link Mono}. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtScopeAsync(String scope, String deploymentName, - DeploymentInner parameters, Context context) { - return beginValidateAtScopeAsync(scope, deploymentName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope(String scope, String filter, Integer top, + Context context) { + return new PagedIterable<>(listAtScopeAsync(scope, filter, top, context)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, - DeploymentInner parameters) { - return validateAtScopeAsync(scope, deploymentName, parameters).block(); + public Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.cancelAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, - DeploymentInner parameters, Context context) { - return validateAtScopeAsync(scope, deploymentName, parameters, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> exportTemplateAtScopeWithResponseAsync(String scope, - String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.exportTemplateAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports the template used for specified deployment. - * - * @param scope The resource scope. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportTemplateAtScopeWithResponseAsync(String scope, - String deploymentName, Context context) { + private Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1649,76 +1432,84 @@ private Mono> exportTemplateAtScopeWithRes if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtScope(this.client.getEndpoint(), scope, deploymentName, - this.client.getApiVersion(), accept, context); + return service.cancelAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, + context); } /** - * Exports the template used for specified deployment. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtScopeAsync(String scope, String deploymentName) { - return exportTemplateAtScopeWithResponseAsync(scope, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono cancelAtScopeAsync(String scope, String deploymentName) { + return cancelAtScopeWithResponseAsync(scope, deploymentName).flatMap(ignored -> Mono.empty()); } /** - * Exports the template used for specified deployment. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtScopeWithResponse(String scope, String deploymentName, - Context context) { - return exportTemplateAtScopeWithResponseAsync(scope, deploymentName, context).block(); + public Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context) { + return cancelAtScopeWithResponseAsync(scope, deploymentName, context).block(); } /** - * Exports the template used for specified deployment. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName) { - return exportTemplateAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); + public void cancelAtScope(String scope, String deploymentName) { + cancelAtScopeWithResponse(scope, deploymentName, Context.NONE); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync(String scope, String filter, - Integer top) { + public Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, + DeploymentInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1726,32 +1517,39 @@ private Mono> listAtScopeSinglePageAsync( if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtScope(this.client.getEndpoint(), scope, filter, top, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.validateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), + scope, deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtScopeSinglePageAsync(String scope, String filter, - Integer top, Context context) { + private Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName, + DeploymentInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1759,343 +1557,379 @@ private Mono> listAtScopeSinglePageAsync( if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listAtScope(this.client.getEndpoint(), scope, filter, top, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.validateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, deploymentName, + contentType, accept, parameters, context); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope, String filter, Integer top) { - return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top), - nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, DeploymentValidateResultInner> + beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters) { + Mono>> mono = validateAtScopeWithResponseAsync(scope, deploymentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, + this.client.getContext()); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtScopeAsync(String scope) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top), - nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = validateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, + context); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtScopeAsync(String scope, String filter, Integer top, - Context context) { - return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top, context), - nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters) { + return this.beginValidateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope(String scope) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAtScopeAsync(scope, filter, top)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context) { + return this.beginValidateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); } /** - * Get all the deployments at the given scope. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * - * @param scope The resource scope. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments at the given scope as paginated response with {@link PagedIterable}. + * @return information from validate template deployment response on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtScope(String scope, String filter, Integer top, - Context context) { - return new PagedIterable<>(listAtScopeAsync(scope, filter, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono validateAtScopeAsync(String scope, String deploymentName, + DeploymentInner parameters) { + return beginValidateAtScopeAsync(scope, deploymentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return information from validate template deployment response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } + private Mono validateAtScopeAsync(String scope, String deploymentName, + DeploymentInner parameters, Context context) { + return beginValidateAtScopeAsync(scope, deploymentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, + DeploymentInner parameters) { + return validateAtScopeAsync(scope, deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, + DeploymentInner parameters, Context context) { + return validateAtScopeAsync(scope, deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> exportTemplateAtScopeWithResponseAsync(String scope, + String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.exportTemplateAtScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName, - Context context) { + private Mono> exportTemplateAtScopeWithResponseAsync(String scope, + String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - accept, context); + return service.exportTemplateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + deploymentName, accept, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the deployment export result on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName) { - Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportTemplateAtScopeAsync(String scope, String deploymentName) { + return exportTemplateAtScopeWithResponseAsync(scope, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the deployment export result along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtScopeWithResponse(String scope, String deploymentName, + Context context) { + return exportTemplateAtScopeWithResponseAsync(scope, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the deployment export result. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName) { - return this.beginDeleteAtTenantScopeAsync(deploymentName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName) { + return exportTemplateAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context) { - return this.beginDeleteAtTenantScopeAsync(deploymentName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAtTenantScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtTenantScopeAsync(String deploymentName) { - return beginDeleteAtTenantScopeAsync(deploymentName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> getAtTenantScopeWithResponseAsync(String deploymentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, accept, + context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtTenantScopeAsync(String deploymentName, Context context) { - return beginDeleteAtTenantScopeAsync(deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono getAtTenantScopeAsync(String deploymentName) { + return getAtTenantScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtTenantScope(String deploymentName) { - deleteAtTenantScopeAsync(deploymentName).block(); + public Response getAtTenantScopeWithResponse(String deploymentName, Context context) { + return getAtTenantScopeWithResponseAsync(deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtTenantScope(String deploymentName, Context context) { - deleteAtTenantScopeAsync(deploymentName, context).block(); + public DeploymentExtendedInner getAtTenantScope(String deploymentName) { + return getAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue(); } /** @@ -2116,10 +1950,9 @@ public Mono> checkExistenceAtTenantScopeWithResponseAsync(Stri if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkExistenceAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.checkExistenceAtTenantScope(this.client.getEndpoint(), + this.client.getApiVersion(), deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2143,10 +1976,9 @@ private Mono> checkExistenceAtTenantScopeWithResponseAsync(Str if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistenceAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context); + return service.checkExistenceAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, context); } /** @@ -2220,10 +2052,11 @@ public Mono>> createOrUpdateAtTenantScopeWithResponseA } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdateAtTenantScope(this.client.getEndpoint(), + this.client.getApiVersion(), deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2255,10 +2088,11 @@ private Mono>> createOrUpdateAtTenantScopeWithResponse } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, contentType, accept, parameters, context); } /** @@ -2419,16 +2253,23 @@ public DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtTenantScopeWithResponseAsync(String deploymentName) { + public Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2436,25 +2277,31 @@ public Mono> getAtTenantScopeWithResponseAsync if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtTenantScopeWithResponseAsync(String deploymentName, + private Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2463,53 +2310,185 @@ private Mono> getAtTenantScopeWithResponseAsyn if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, + return service.deleteAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, context); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName) { + Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName) { + return this.beginDeleteAtTenantScopeAsync(deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtTenantScope(String deploymentName, Context context) { + return this.beginDeleteAtTenantScopeAsync(deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtTenantScopeAsync(String deploymentName) { - return getAtTenantScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAtTenantScopeAsync(String deploymentName) { + return beginDeleteAtTenantScopeAsync(deploymentName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtTenantScopeWithResponse(String deploymentName, Context context) { - return getAtTenantScopeWithResponseAsync(deploymentName, context).block(); + private Mono deleteAtTenantScopeAsync(String deploymentName, Context context) { + return beginDeleteAtTenantScopeAsync(deploymentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtTenantScope(String deploymentName) { - return getAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue(); + public void deleteAtTenantScope(String deploymentName) { + deleteAtTenantScopeAsync(deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAtTenantScope(String deploymentName, Context context) { + deleteAtTenantScopeAsync(deploymentName, context).block(); } /** @@ -2534,10 +2513,9 @@ public Mono> cancelAtTenantScopeWithResponseAsync(String deployme if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.cancelAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.cancelAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2564,10 +2542,9 @@ private Mono> cancelAtTenantScopeWithResponseAsync(String deploym if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.cancelAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - accept, context); + return service.cancelAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, + context); } /** @@ -2651,10 +2628,11 @@ public Mono>> validateAtTenantScopeWithResponseAsync(S } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.validateAtTenantScope(this.client.getEndpoint(), + this.client.getApiVersion(), deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2686,10 +2664,11 @@ private Mono>> validateAtTenantScopeWithResponseAsync( } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - parameters, accept, context); + return service.validateAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, + contentType, accept, parameters, context); } /** @@ -2866,10 +2845,11 @@ public Mono>> whatIfAtTenantScopeWithResponseAsync(Str } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.whatIfAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.whatIfAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2899,10 +2879,11 @@ private Mono>> whatIfAtTenantScopeWithResponseAsync(St } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.whatIfAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - parameters, accept, context); + return service.whatIfAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), deploymentName, + contentType, accept, parameters, context); } /** @@ -3066,8 +3047,8 @@ public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, Sco } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.exportTemplateAtTenantScope(this.client.getEndpoint(), + this.client.getApiVersion(), deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3093,8 +3074,8 @@ public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, Sco } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtTenantScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), accept, context); + return service.exportTemplateAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + deploymentName, accept, context); } /** @@ -3162,8 +3143,8 @@ private Mono> listAtTenantScopeSinglePage } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAtTenantScope(this.client.getEndpoint(), filter, top, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + filter, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -3192,7 +3173,7 @@ private Mono> listAtTenantScopeSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listAtTenantScope(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context) + .listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), filter, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -3279,24 +3260,17 @@ public PagedIterable listAtTenantScope(String filter, I } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, + public Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -3310,20 +3284,13 @@ public Mono>> deleteAtManagementGroupScopeWithResponse } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -3331,10 +3298,10 @@ public Mono>> deleteAtManagementGroupScopeWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, + private Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -3348,44 +3315,28 @@ private Mono>> deleteAtManagementGroupScopeWithRespons } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), accept, context); + return service.getAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, accept, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, - String deploymentName) { - Mono>> mono = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -3393,152 +3344,27 @@ public PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtManagementGroupScopeWithResponse(String groupId, String deploymentName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName) { - return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).getSyncPoller(); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName, - Context context) { - return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).getSyncPoller(); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) { - return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroupScope(String groupId, String deploymentName) { - deleteAtManagementGroupScopeAsync(groupId, deploymentName).block(); - } - - /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. - * - * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) { - deleteAtManagementGroupScopeAsync(groupId, deploymentName, context).block(); + public DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName) { + return getAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); } /** @@ -3564,10 +3390,9 @@ public Mono> checkExistenceAtManagementGroupScopeWithResponseA if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3595,10 +3420,9 @@ private Mono> checkExistenceAtManagementGroupScopeWithResponse if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), accept, context); + return service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), + groupId, deploymentName, context); } /** @@ -3680,10 +3504,11 @@ public Mono>> createOrUpdateAtManagementGroupScopeWith } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3719,10 +3544,11 @@ private Mono>> createOrUpdateAtManagementGroupScopeWit } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), parameters, accept, context); + return service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), + groupId, deploymentName, contentType, accept, parameters, context); } /** @@ -3896,17 +3722,24 @@ public DeploymentExtendedInner createOrUpdateAtManagementGroupScope(String group } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, + public Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -3918,15 +3751,21 @@ public Mono> getAtManagementGroupScopeWithResp if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deleteAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -3934,10 +3773,10 @@ public Mono> getAtManagementGroupScopeWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupScopeWithResponseAsync(String groupId, + private Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -3949,30 +3788,45 @@ private Mono> getAtManagementGroupScopeWithRes if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), accept, context); + return service.deleteAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, context); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, + String deploymentName) { + Mono>> mono = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -3980,170 +3834,170 @@ public Mono getAtManagementGroupScopeAsync(String group * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupScopeWithResponse(String groupId, + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) { - return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + context = this.client.mergeContext(context); + Mono>> mono + = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Gets a deployment. + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName) { - return getAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName) { + return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).getSyncPoller(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAtManagementGroupScope(String groupId, String deploymentName, + Context context) { + return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).getSyncPoller(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), accept, context); + public Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAtManagementGroupScopeAsync(String groupId, String deploymentName) { - return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName).flatMap(ignored -> Mono.empty()); + private Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) { + return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName, - Context context) { - return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + public void deleteAtManagementGroupScope(String groupId, String deploymentName) { + deleteAtManagementGroupScopeAsync(groupId, deploymentName).block(); } /** - * Cancels a currently running template deployment. + * Deletes a deployment from the deployment history. * - * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is - * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running - * template deployment and leaves the resources partially deployed. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancelAtManagementGroupScope(String groupId, String deploymentName) { - cancelAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE); + public void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) { + deleteAtManagementGroupScopeAsync(groupId, deploymentName, context).block(); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response along with {@link Response} on successful - * completion of {@link Mono}. + * @return all the deployments for a management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId, - String deploymentName, ScopedDeployment parameters) { + private Mono> listAtManagementGroupScopeSinglePageAsync(String groupId, + String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4151,38 +4005,32 @@ public Mono>> validateAtManagementGroupScopeWithRespon if (groupId == null) { return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.listAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response along with {@link Response} on successful - * completion of {@link Mono}. + * @return all the deployments for a management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId, - String deploymentName, ScopedDeployment parameters, Context context) { + private Mono> listAtManagementGroupScopeSinglePageAsync(String groupId, + String filter, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4190,184 +4038,232 @@ private Mono>> validateAtManagementGroupScopeWithRespo if (groupId == null) { return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), parameters, accept, context); + return service + .listAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, filter, top, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments for a management group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentValidateResultInner> - beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters) { - Mono>> mono - = validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, + Integer top) { + return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtManagementGroupScopeAsync(String groupId) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments for a management group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentValidateResultInner> - beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, + Integer top, Context context) { + return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top, context), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { - return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope(String groupId) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Get all the deployments for a management group. * * @param groupId The management group ID. - * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 information from validate template deployment response. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentValidateResultInner> - beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters, - Context context) { - return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope(String groupId, String filter, Integer top, + Context context) { + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top, context)); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono validateAtManagementGroupScopeAsync(String groupId, - String deploymentName, ScopedDeployment parameters) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.cancelAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAtManagementGroupScopeAsync(String groupId, - String deploymentName, ScopedDeployment parameters, Context context) { - return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.cancelAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, context); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName, - ScopedDeployment parameters) { - return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); + public Mono cancelAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName).flatMap(ignored -> Mono.empty()); } /** - * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource - * Manager.. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. - * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information from validate template deployment response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName, - ScopedDeployment parameters, Context context) { - return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); + public Response cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName, + Context context) { + return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Cancels a currently running template deployment. + * + * You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void cancelAtManagementGroupScope(String groupId, String deploymentName) { + cancelAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4375,11 +4271,12 @@ public DeploymentValidateResultInner validateAtManagementGroupScope(String group * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId, - String deploymentName, ScopedDeploymentWhatIf parameters) { + public Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId, + String deploymentName, ScopedDeployment parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4395,15 +4292,17 @@ public Mono>> whatIfAtManagementGroupScopeWithResponse } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.whatIfAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.validateAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4412,11 +4311,12 @@ public Mono>> whatIfAtManagementGroupScopeWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId, - String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + private Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId, + String deploymentName, ScopedDeployment parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4432,14 +4332,16 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.whatIfAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), parameters, accept, context); + return service.validateAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, contentType, accept, parameters, context); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4447,21 +4349,21 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 result of the What-If operation. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, - ScopedDeploymentWhatIf parameters) { + public PollerFlux, DeploymentValidateResultInner> + beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters) { Mono>> mono - = whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, + = validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, this.client.getContext()); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4470,21 +4372,23 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 result of the What-If operation. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono - = whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, context); + = validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class, + context); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4492,16 +4396,17 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 result of the What-If operation. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { - return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { + return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4510,18 +4415,19 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 result of the What-If operation. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WhatIfOperationResultInner> - beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters, Context context) { - return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) .getSyncPoller(); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4529,17 +4435,18 @@ private Mono>> whatIfAtManagementGroupScopeWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation on successful completion of {@link Mono}. + * @return information from validate template deployment response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, - ScopedDeploymentWhatIf parameters) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last() + public Mono validateAtManagementGroupScopeAsync(String groupId, + String deploymentName, ScopedDeployment parameters) { + return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4548,17 +4455,18 @@ public Mono whatIfAtManagementGroupScopeAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation on successful completion of {@link Mono}. + * @return information from validate template deployment response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, - ScopedDeploymentWhatIf parameters, Context context) { - return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last() + private Mono validateAtManagementGroupScopeAsync(String groupId, + String deploymentName, ScopedDeployment parameters, Context context) { + return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4566,16 +4474,17 @@ private Mono whatIfAtManagementGroupScopeAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. + * @return information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName, - ScopedDeploymentWhatIf parameters) { - return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); + public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName, + ScopedDeployment parameters) { + return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); } /** - * Returns changes that will be made by the deployment if executed at the scope of the management group. + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. @@ -4584,27 +4493,28 @@ public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the What-If operation. + * @return information from validate template deployment response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName, - ScopedDeploymentWhatIf parameters, Context context) { - return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); + public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName, + ScopedDeployment parameters, Context context) { + return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { + public Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId, + String deploymentName, ScopedDeploymentWhatIf parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4615,27 +4525,34 @@ public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, S if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), groupId, - deploymentName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.whatIfAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, Context context) { + private Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId, + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4646,466 +4563,382 @@ public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, S if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, - this.client.getApiVersion(), accept, context); + return service.whatIfAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), groupId, + deploymentName, contentType, accept, parameters, context); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtManagementGroupScopeAsync(String groupId, - String deploymentName) { - return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, + ScopedDeploymentWhatIf parameters) { + Mono>> mono + = whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, + this.client.getContext()); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response}. + * @return the {@link PollerFlux} for polling of result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtManagementGroupScopeWithResponse(String groupId, - String deploymentName, Context context) { - return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, context); } /** - * Exports the template used for specified deployment. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. + * @return the {@link SyncPoller} for polling of result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName) { - return exportTemplateAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a management group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync(String groupId, - String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtManagementGroupScope(this.client.getEndpoint(), groupId, filter, top, - 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())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); } /** - * Get all the deployments for a management group. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a management group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtManagementGroupScopeSinglePageAsync(String groupId, - String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtManagementGroupScope(this.client.getEndpoint(), groupId, filter, top, this.client.getApiVersion(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get all the deployments for a management group. - * - * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a management group as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, - Integer top) { - return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, + Context context) { + return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .getSyncPoller(); } /** - * Get all the deployments for a management group. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a management group as paginated response with {@link PagedFlux}. + * @return result of the What-If operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtManagementGroupScopeAsync(String groupId) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, + ScopedDeploymentWhatIf parameters) { + return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get all the deployments for a management group. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a management group as paginated response with {@link PagedFlux}. + * @return result of the What-If operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtManagementGroupScopeAsync(String groupId, String filter, - Integer top, Context context) { - return new PagedFlux<>(() -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top, context), - nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, + ScopedDeploymentWhatIf parameters, Context context) { + return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get all the deployments for a management group. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a management group as paginated response with {@link PagedIterable}. + * @return result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope(String groupId) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName, + ScopedDeploymentWhatIf parameters) { + return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); } /** - * Get all the deployments for a management group. + * Returns changes that will be made by the deployment if executed at the scope of the management group. * * @param groupId The management group ID. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a management group as paginated response with {@link PagedIterable}. + * @return result of the What-If operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtManagementGroupScope(String groupId, String filter, Integer top, - Context context) { - return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName, + ScopedDeploymentWhatIf parameters, Context context) { + return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName) { + public Mono> + exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), + this.client.getApiVersion(), groupId, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName, - Context context) { + private Mono> + exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtSubscriptionScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), + groupId, deploymentName, accept, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the deployment export result on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName) { - Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportTemplateAtManagementGroupScopeAsync(String groupId, + String deploymentName) { + return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the deployment export result along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtManagementGroupScopeWithResponse(String groupId, + String deploymentName, Context context) { + return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Exports the template used for specified deployment. * + * @param groupId The management group ID. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the deployment export result. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName) { - return this.beginDeleteAtSubscriptionScopeAsync(deploymentName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName) { + return exportTemplateAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context) { - return this.beginDeleteAtSubscriptionScopeAsync(deploymentName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtSubscriptionScopeAsync(String deploymentName) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, accept, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtSubscriptionScopeAsync(String deploymentName, Context context) { - return beginDeleteAtSubscriptionScopeAsync(deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono getAtSubscriptionScopeAsync(String deploymentName) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscriptionScope(String deploymentName) { - deleteAtSubscriptionScopeAsync(deploymentName).block(); + public Response getAtSubscriptionScopeWithResponse(String deploymentName, + Context context) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the - * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain - * the status of the process. While the process is running, a call to the URI in the Location header returns a - * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If - * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * Gets a deployment. * * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtSubscriptionScope(String deploymentName, Context context) { - deleteAtSubscriptionScopeAsync(deploymentName, context).block(); + public DeploymentExtendedInner getAtSubscriptionScope(String deploymentName) { + return getAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); } /** @@ -5123,17 +4956,16 @@ public Mono> checkExistenceAtSubscriptionScopeWithResponseAsyn return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } return FluxUtil - .withContext(context -> service.checkExistenceAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.checkExistenceAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5154,17 +4986,16 @@ private Mono> checkExistenceAtSubscriptionScopeWithResponseAsy return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } context = this.client.mergeContext(context); - return service.checkExistenceAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.checkExistenceAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, context); } /** @@ -5204,349 +5035,643 @@ public Response checkExistenceAtSubscriptionScopeWithResponse(String de * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceAtSubscriptionScope(String deploymentName) { + return checkExistenceAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, + DeploymentInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, contentType, accept, + parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, + DeploymentInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdateAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, contentType, accept, parameters, context); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters) { + Mono>> mono + = createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters) { + return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context) { + return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, + DeploymentInner parameters) { + return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, + DeploymentInner parameters, Context context) { + return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, + DeploymentInner parameters) { + return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).block(); + } + + /** + * Deploys resources at subscription scope. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceAtSubscriptionScope(String deploymentName) { - return checkExistenceAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + public DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, + Context context) { + return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, - DeploymentInner parameters) { + public Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.deleteAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync(String deploymentName, - DeploymentInner parameters, Context context) { + private Mono>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.deleteAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, context); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters) { - Mono>> mono - = createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, + public PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName) { + Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, DeploymentInner parameters, - Context context) { + private PollerFlux, Void> beginDeleteAtSubscriptionScopeAsync(String deploymentName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context); + Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters) { - return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); + public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName) { + return this.beginDeleteAtSubscriptionScopeAsync(deploymentName).getSyncPoller(); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, Context context) { - return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDeleteAtSubscriptionScope(String deploymentName, Context context) { + return this.beginDeleteAtSubscriptionScopeAsync(deploymentName, context).getSyncPoller(); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, - DeploymentInner parameters) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).last() + public Mono deleteAtSubscriptionScopeAsync(String deploymentName) { + return beginDeleteAtSubscriptionScopeAsync(deploymentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtSubscriptionScopeAsync(String deploymentName, - DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).last() + private Mono deleteAtSubscriptionScopeAsync(String deploymentName, Context context) { + return beginDeleteAtSubscriptionScopeAsync(deploymentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, - DeploymentInner parameters) { - return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).block(); + public void deleteAtSubscriptionScope(String deploymentName) { + deleteAtSubscriptionScopeAsync(deploymentName).block(); } /** - * Deploys resources at subscription scope. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. * * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, DeploymentInner parameters, - Context context) { - return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); + public void deleteAtSubscriptionScope(String deploymentName, Context context) { + deleteAtSubscriptionScopeAsync(deploymentName, context).block(); } /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return all the deployments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName) { + private Mono> listSinglePageAsync(String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return all the deployments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName, + private Mono> listSinglePageAsync(String filter, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtSubscriptionScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, top, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); } /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtSubscriptionScopeAsync(String deploymentName) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); } /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtSubscriptionScopeWithResponse(String deploymentName, - Context context) { - return getAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); } /** - * Gets a deployment. + * Get all the deployments for a subscription. * - * @param deploymentName The name of the deployment. + * @throws 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 deployments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getAtSubscriptionScope(String deploymentName) { - return getAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); } /** @@ -5568,17 +5693,16 @@ public Mono> cancelAtSubscriptionScopeWithResponseAsync(String de return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } return FluxUtil - .withContext(context -> service.cancelAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.cancelAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5602,17 +5726,16 @@ private Mono> cancelAtSubscriptionScopeWithResponseAsync(String d return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } context = this.client.mergeContext(context); - return service.cancelAtSubscriptionScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.cancelAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, context); } /** @@ -5688,22 +5811,24 @@ public Mono>> validateAtSubscriptionScopeWithResponseA return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext( + context -> service.validateAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5727,22 +5852,23 @@ private Mono>> validateAtSubscriptionScopeWithResponse return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.validateAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, contentType, accept, parameters, context); } /** @@ -5913,22 +6039,24 @@ public Mono>> whatIfAtSubscriptionScopeWithResponseAsy return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.whatIfAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext( + context -> service.whatIfAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5950,22 +6078,23 @@ private Mono>> whatIfAtSubscriptionScopeWithResponseAs return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.whatIfAtSubscriptionScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.whatIfAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, contentType, accept, parameters, context); } /** @@ -6124,17 +6253,17 @@ public WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentNam return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.exportTemplateAtSubscriptionScope(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6151,82 +6280,6 @@ public WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> exportTemplateAtSubscriptionScopeWithResponseAsync(String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.exportTemplateAtSubscriptionScope(this.client.getEndpoint(), deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono exportTemplateAtSubscriptionScopeAsync(String deploymentName) { - return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportTemplateAtSubscriptionScopeWithResponse(String deploymentName, - Context context) { - return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); - } - - /** - * Exports the template used for specified deployment. - * - * @param deploymentName The name of the deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployment export result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName) { - return exportTemplateAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -6235,154 +6288,81 @@ private Mono> listSinglePageAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get all the deployments for a subscription. - * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); + return service.exportTemplateAtSubscriptionScope(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), deploymentName, accept, context); } /** - * Get all the deployments for a subscription. + * Exports the template used for specified deployment. * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a subscription as paginated response with {@link PagedFlux}. + * @return the deployment export result on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), - nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono exportTemplateAtSubscriptionScopeAsync(String deploymentName) { + return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get all the deployments for a subscription. + * Exports the template used for specified deployment. * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a subscription as paginated response with {@link PagedIterable}. + * @return the deployment export result along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtSubscriptionScopeWithResponse(String deploymentName, + Context context) { + return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); } /** - * Get all the deployments for a subscription. + * Exports the template used for specified deployment. * - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. + * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 deployments for a subscription as paginated response with {@link PagedIterable}. + * @return the deployment export result. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName) { + return exportTemplateAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName) { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6390,44 +6370,35 @@ public Mono>> deleteWithResponseAsync(String resourceG if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, - Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String deploymentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6435,236 +6406,199 @@ private Mono>> deleteWithResponseAsync(String resource if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, accept, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return a deployment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String deploymentName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Gets a deployment. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return a deployment. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName) { - return this.beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName) { + return getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.checkExistence(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.checkExistence(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, context); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return whether resource exists on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono checkExistenceAsync(String resourceGroupName, String deploymentName) { + return checkExistenceWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deploymentName) { - deleteAsync(resourceGroupName, deploymentName).block(); + public Response checkExistenceWithResponse(String resourceGroupName, String deploymentName, + Context context) { + return checkExistenceWithResponseAsync(resourceGroupName, deploymentName, context).block(); } /** - * Deletes a deployment from the deployment history. - * - * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the - * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. - * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully - * deleted. The Location response header contains the URI that is used to obtain the status of the process. While - * the process is running, a call to the URI in the Location header returns a status of 202. When the process - * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, - * the URI in the Location header returns an error-level status code. + * Checks whether the deployment exists. * - * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String deploymentName, Context context) { - deleteAsync(resourceGroupName, deploymentName, context).block(); + public boolean checkExistence(String resourceGroupName, String deploymentName) { + return checkExistenceWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); } /** - * Checks whether the deployment exists. + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName) { + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deploymentName, DeploymentInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6672,36 +6606,45 @@ public Mono> checkExistenceWithResponseAsync(String resourceGr if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkExistence(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Checks whether the deployment exists. + * Deploys resources to a resource group. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String deploymentName, DeploymentInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6709,65 +6652,163 @@ private Mono> checkExistenceWithResponseAsync(String resourceG if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistence(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, contentType, accept, parameters, + context); } /** - * Checks whether the deployment exists. + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context); + } + + /** + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAsync(String resourceGroupName, String deploymentName) { - return checkExistenceWithResponseAsync(resourceGroupName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, + DeploymentInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Checks whether the deployment exists. + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response}. + * @return deployment information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceWithResponse(String resourceGroupName, String deploymentName, - Context context) { - return checkExistenceWithResponseAsync(resourceGroupName, deploymentName, context).block(); + private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, + DeploymentInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Checks whether the deployment exists. + * Deploys resources to a resource group. + * + * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group with the deployment to check. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. + * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistence(String resourceGroupName, String deploymentName) { - return checkExistenceWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, + DeploymentInner parameters) { + return createOrUpdateAsync(resourceGroupName, deploymentName, parameters).block(); } /** @@ -6775,22 +6816,49 @@ public boolean checkExistence(String resourceGroupName, String deploymentName) { * * You can provide the template and parameters directly in the request or link to JSON files. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, DeploymentInner parameters) { + public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, + DeploymentInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6798,44 +6866,42 @@ public Mono>> createOrUpdateWithResponseAsync(String r if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, DeploymentInner parameters, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -6843,311 +6909,370 @@ private Mono>> createOrUpdateWithResponseAsync(String if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, context); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DeploymentExtendedInner> - beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentExtendedInner> - beginCreateOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName) { + return this.beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 deployment information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( - String resourceGroupName, String deploymentName, DeploymentInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, - DeploymentInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).last() + public Mono deleteAsync(String resourceGroupName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, deploymentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, - DeploymentInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).last() + private Mono deleteAsync(String resourceGroupName, String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, - DeploymentInner parameters) { - return createOrUpdateAsync(resourceGroupName, deploymentName, parameters).block(); + public void delete(String resourceGroupName, String deploymentName) { + deleteAsync(resourceGroupName, deploymentName).block(); } /** - * Deploys resources to a resource group. + * Deletes a deployment from the deployment history. * - * You can provide the template and parameters directly in the request or link to JSON files. + * A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. * - * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. - * The resource group must already exist. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. - * @param parameters Additional parameters supplied to the operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return deployment information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, - DeploymentInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).block(); + public void delete(String resourceGroupName, String deploymentName, Context context) { + deleteAsync(resourceGroupName, deploymentName, context).block(); } /** - * Gets a deployment. + * Get all the deployments for a resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return all the deployments for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - deploymentName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a deployment. + * Get all the deployments for a resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response} on successful completion of {@link Mono}. + * @return all the deployments for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets a deployment. + * Get all the deployments for a resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment on successful completion of {@link Mono}. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + Integer top, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Gets a deployment. + * Get all the deployments for a resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment along with {@link Response}. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String deploymentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); } /** - * Gets a deployment. + * Get all the deployments for a resource group. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of the deployment. + * @param resourceGroupName The name of the resource group. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a deployment. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName) { - return getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); } /** @@ -7157,7 +7282,7 @@ public DeploymentExtendedInner getByResourceGroup(String resourceGroupName, Stri * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7170,6 +7295,10 @@ public Mono> cancelWithResponseAsync(String resourceGroupName, St return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7177,14 +7306,9 @@ public Mono> cancelWithResponseAsync(String resourceGroupName, St if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.cancel(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7195,7 +7319,7 @@ public Mono> cancelWithResponseAsync(String resourceGroupName, St * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7210,6 +7334,10 @@ private Mono> cancelWithResponseAsync(String resourceGroupName, S return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7217,14 +7345,9 @@ private Mono> cancelWithResponseAsync(String resourceGroupName, S if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.cancel(this.client.getEndpoint(), resourceGroupName, deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, context); } /** @@ -7234,7 +7357,7 @@ private Mono> cancelWithResponseAsync(String resourceGroupName, S * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7253,7 +7376,7 @@ public Mono cancelAsync(String resourceGroupName, String deploymentName) { * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7273,7 +7396,7 @@ public Response cancelWithResponse(String resourceGroupName, String deploy * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running * template deployment and leaves the resource group partially deployed. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7288,8 +7411,7 @@ public void cancel(String resourceGroupName, String deploymentName) { * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7305,6 +7427,10 @@ public Mono>> validateWithResponseAsync(String resourc return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7312,19 +7438,17 @@ public Mono>> validateWithResponseAsync(String resourc if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7332,8 +7456,7 @@ public Mono>> validateWithResponseAsync(String resourc * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7350,6 +7473,10 @@ private Mono>> validateWithResponseAsync(String resour return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7357,27 +7484,23 @@ private Mono>> validateWithResponseAsync(String resour if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.validate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, contentType, accept, parameters, context); } /** * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7399,8 +7522,7 @@ private Mono>> validateWithResponseAsync(String resour * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7424,8 +7546,7 @@ private PollerFlux, DeploymentValidate * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7443,8 +7564,7 @@ private PollerFlux, DeploymentValidate * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7463,8 +7583,7 @@ private PollerFlux, DeploymentValidate * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7483,8 +7602,7 @@ public Mono validateAsync(String resourceGroupNam * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7504,8 +7622,7 @@ private Mono validateAsync(String resourceGroupNa * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7523,8 +7640,7 @@ public DeploymentValidateResultInner validate(String resourceGroupName, String d * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource * Manager.. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7542,8 +7658,7 @@ public DeploymentValidateResultInner validate(String resourceGroupName, String d /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7558,6 +7673,10 @@ public Mono>> whatIfWithResponseAsync(String resourceG return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7565,27 +7684,24 @@ public Mono>> whatIfWithResponseAsync(String resourceG if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.whatIf(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.whatIf(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7601,6 +7717,10 @@ private Mono>> whatIfWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7608,26 +7728,22 @@ private Mono>> whatIfWithResponseAsync(String resource if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.whatIf(this.client.getEndpoint(), resourceGroupName, deploymentName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.whatIf(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, contentType, accept, parameters, context); } /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7647,8 +7763,7 @@ private Mono>> whatIfWithResponseAsync(String resource /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7670,8 +7785,7 @@ private PollerFlux, WhatIfOperationResult /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7688,8 +7802,7 @@ private PollerFlux, WhatIfOperationResult /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7707,8 +7820,7 @@ private PollerFlux, WhatIfOperationResult /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7726,8 +7838,7 @@ public Mono whatIfAsync(String resourceGroupName, St /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7746,8 +7857,7 @@ private Mono whatIfAsync(String resourceGroupName, S /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7764,8 +7874,7 @@ public WhatIfOperationResultInner whatIf(String resourceGroupName, String deploy /** * Returns changes that will be made by the deployment if executed at the scope of the resource group. * - * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case - * insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param parameters Parameters to validate. * @param context The context to associate with this operation. @@ -7783,7 +7892,7 @@ public WhatIfOperationResultInner whatIf(String resourceGroupName, String deploy /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7797,6 +7906,10 @@ public Mono> exportTemplateWithResponseAsy return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7804,21 +7917,17 @@ public Mono> exportTemplateWithResponseAsy if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.exportTemplate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7833,6 +7942,10 @@ private Mono> exportTemplateWithResponseAs return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -7840,20 +7953,16 @@ private Mono> exportTemplateWithResponseAs if (deploymentName == null) { return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplate(this.client.getEndpoint(), resourceGroupName, deploymentName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.exportTemplate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, deploymentName, accept, context); } /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7869,7 +7978,7 @@ public Mono exportTemplateAsync(String resourceGrou /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -7886,7 +7995,7 @@ public Response exportTemplateWithResponse(String r /** * Exports the template used for specified deployment. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group. * @param deploymentName The name of the deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -7898,183 +8007,10 @@ public DeploymentExportResultInner exportTemplate(String resourceGroupName, Stri return exportTemplateWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); } - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, filter, - top, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, filter, top, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - Integer top) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - Integer top, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); - } - - /** - * Get all the deployments for a resource group. - * - * @param resourceGroupName The name of the resource group with the deployments to get. The name is case - * insensitive. - * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq - * '{state}'. - * @param top The number of results to get. If null is passed, returns all deployments. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deployments for a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); - } - /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -8090,17 +8026,18 @@ public Mono> calculateTemplateHashWithResponse if (template == null) { return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.calculateTemplateHash(this.client.getEndpoint(), - this.client.getApiVersion(), template, accept, context)) + this.client.getApiVersion(), contentType, accept, template, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -8118,16 +8055,17 @@ private Mono> calculateTemplateHashWithRespons if (template == null) { return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.calculateTemplateHash(this.client.getEndpoint(), this.client.getApiVersion(), template, accept, - context); + return service.calculateTemplateHash(this.client.getEndpoint(), this.client.getApiVersion(), contentType, + accept, template, context); } /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -8141,7 +8079,7 @@ public Mono calculateTemplateHashAsync(Object template) /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -8156,7 +8094,7 @@ public Response calculateTemplateHashWithResponse(Objec /** * Calculate the hash of the given template. * - * @param template The template provided to calculate hash. + * @param template The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientBuilder.java index a3bda91c6cc6..3af9d5dc581f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { DeploymentsManagementClientImpl.class }) public final class DeploymentsManagementClientBuilder { /* - * The Microsoft Azure subscription ID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The Microsoft Azure subscription ID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the DeploymentsManagementClientBuilder. */ - public DeploymentsManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public DeploymentsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the DeploymentsManagementClientBuilder. */ - public DeploymentsManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public DeploymentsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public DeploymentsManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); DeploymentsManagementClientImpl client = new DeploymentsManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientImpl.java index 66052f62e0b9..2c461424a314 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,26 +20,12 @@ @ServiceClient(builder = DeploymentsManagementClientBuilder.class) public final class DeploymentsManagementClientImpl extends AzureServiceClient implements DeploymentsManagementClient { /** - * The Microsoft Azure subscription ID. - */ - private final String subscriptionId; - - /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -48,12 +34,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -61,6 +47,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -138,17 +138,17 @@ public DeploymentOperationsClient getDeploymentOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The Microsoft Azure subscription ID. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ DeploymentsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2025-04-01"; this.deployments = new DeploymentsClientImpl(this); this.deploymentOperations = new DeploymentOperationsClientImpl(this); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java index a9558e23fd62..753034072858 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java index bfefa5c8ba43..3570856fc4ba 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeatureClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java index cfdba14e2c51..daadae38bfa4 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/FeaturesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java index 6b549081638d..25683d2999f0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java index 86e92a4ef31d..ad03953d697d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLockClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java index 8cf6c5b095ed..ebc4afadaaab 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ManagementLocksClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java index 52314510f45b..bcca4365c4ae 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.OperationsClient; import com.azure.resourcemanager.resources.fluent.models.OperationInner; -import com.azure.resourcemanager.resources.models.OperationListResult; +import com.azure.resourcemanager.resources.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,14 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for ResourceManagementClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ResourceManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Resources/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,15 +74,15 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -101,13 +101,13 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -124,11 +124,11 @@ private Mono> listSinglePageAsync(Context context) } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -137,13 +137,13 @@ public PagedFlux listAsync() { } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -153,11 +153,11 @@ private PagedFlux listAsync(Context context) { } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -166,13 +166,13 @@ public PagedIterable list() { } /** - * Lists all of the available Microsoft.Resources REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -187,7 +187,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -214,7 +214,7 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java index 45d45ecde96c..fe37374a33d0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -33,7 +33,7 @@ import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.PolicyAssignmentListResult; +import com.azure.resourcemanager.resources.implementation.models.PolicyAssignmentListResult; import com.azure.resourcemanager.resources.models.PolicyAssignmentUpdate; import reactor.core.publisher.Mono; @@ -67,144 +67,127 @@ public final class PolicyAssignmentsClientImpl implements InnerSupportsListing

> delete(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, + Mono> getById(@HostParam("endpoint") String endpoint, + @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") + @Put("/{policyAssignmentId}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentInner parameters, @HeaderParam("Accept") String accept, + Mono> createById(@HostParam("endpoint") String endpoint, + @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PolicyAssignmentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") + @Patch("/{policyAssignmentId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("policyAssignmentName") String policyAssignmentName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentUpdate parameters, @HeaderParam("Accept") String accept, + Mono> updateById(@HostParam("endpoint") String endpoint, + @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PolicyAssignmentUpdate parameters, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments") - @ExpectedResponses({ 200 }) + @Delete("/{policyAssignmentId}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> deleteById(@HostParam("endpoint") String endpoint, + @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments") + @Get("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResource(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, - @PathParam(value = "resourceType", encoded = true) String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("policyAssignmentName") String policyAssignmentName, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments") - @ExpectedResponses({ 200 }) + @Put("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("policyAssignmentName") String policyAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyAssignmentInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments") + @Patch("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("policyAssignmentName") String policyAssignmentName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyAssignmentUpdate parameters, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/{policyAssignmentId}") + @Delete("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteById(@HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @PathParam("policyAssignmentName") String policyAssignmentName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/{policyAssignmentId}") - @ExpectedResponses({ 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createById(@HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentInner parameters, @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{policyAssignmentId}") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById(@HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listForManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/{policyAssignmentId}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateById(@HostParam("$host") String endpoint, - @PathParam(value = "policyAssignmentId", encoded = true) String policyAssignmentId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyAssignmentUpdate parameters, @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listForResource(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listForResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Mono> listForResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -212,7 +195,7 @@ Mono> listForResourceNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listForManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -220,62 +203,64 @@ Mono> listForManagementGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForResourceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String scope, String policyAssignmentName) { + public Mono> getByIdWithResponseAsync(String policyAssignmentId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, - accept, context)) + .withContext(context -> service.getById(this.client.getEndpoint(), policyAssignmentId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -283,61 +268,55 @@ public Mono> deleteWithResponseAsync(String scop * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String policyAssignmentName, - Context context) { + private Mono> getByIdWithResponseAsync(String policyAssignmentId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, accept, context); + return service.getById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), accept, + context); } /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String scope, String policyAssignmentName) { - return deleteWithResponseAsync(scope, policyAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getByIdAsync(String policyAssignmentId) { + return getByIdWithResponseAsync(policyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -345,94 +324,91 @@ public Mono deleteAsync(String scope, String policyAssign * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String policyAssignmentName, - Context context) { - return deleteWithResponseAsync(scope, policyAssignmentName, context).block(); + public Response getByIdWithResponse(String policyAssignmentId, Context context) { + return getByIdWithResponseAsync(policyAssignmentId, context).block(); } /** - * Deletes a policy assignment. - * - * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy - * assignment is the part of its ID preceding - * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * Retrieves the policy assignment with the given ID. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to delete. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner delete(String scope, String policyAssignmentName) { - return deleteWithResponse(scope, policyAssignmentName, Context.NONE).getValue(); + public PolicyAssignmentInner getById(String policyAssignmentId) { + return getByIdWithResponse(policyAssignmentId, Context.NONE).getValue(); } /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(String scope, String policyAssignmentName, + public Mono> createByIdWithResponseAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, - parameters, accept, context)) + .withContext(context -> service.createById(this.client.getEndpoint(), policyAssignmentId, + this.client.getApiVersion(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -440,71 +416,69 @@ public Mono> createWithResponseAsync(String scop * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String scope, String policyAssignmentName, + private Mono> createByIdWithResponseAsync(String policyAssignmentId, PolicyAssignmentInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, parameters, accept, - context); + return service.createById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), + contentType, accept, parameters, context); } /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync(String scope, String policyAssignmentName, - PolicyAssignmentInner parameters) { - return createWithResponseAsync(scope, policyAssignmentName, parameters) + public Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { + return createByIdWithResponseAsync(policyAssignmentId, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -512,88 +486,95 @@ public Mono createAsync(String scope, String policyAssign * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String scope, String policyAssignmentName, + public Response createByIdWithResponse(String policyAssignmentId, PolicyAssignmentInner parameters, Context context) { - return createWithResponseAsync(scope, policyAssignmentName, parameters, context).block(); + return createByIdWithResponseAsync(policyAssignmentId, parameters, context).block(); } /** * Creates or updates a policy assignment. * - * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to - * all resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. - * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope + * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that + * policy applies to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for the policy assignment. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { - return createWithResponse(scope, policyAssignmentName, parameters, Context.NONE).getValue(); + public PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters) { + return createByIdWithResponse(policyAssignmentId, parameters, Context.NONE).getValue(); } /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String scope, String policyAssignmentName, - String expand) { + public Mono> updateByIdWithResponseAsync(String policyAssignmentId, + PolicyAssignmentUpdate parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), scope, policyAssignmentName, expand, - apiVersion, accept, context)) + .withContext(context -> service.updateById(this.client.getEndpoint(), policyAssignmentId, + this.client.getApiVersion(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -601,61 +582,69 @@ public Mono> getWithResponseAsync(String scope, * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String policyAssignmentName, - String expand, Context context) { + private Mono> updateByIdWithResponseAsync(String policyAssignmentId, + PolicyAssignmentUpdate parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), scope, policyAssignmentName, expand, apiVersion, accept, context); + return service.updateById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), + contentType, accept, parameters, context); } /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String scope, String policyAssignmentName) { - final String expand = null; - return getWithResponseAsync(scope, policyAssignmentName, expand) + public Mono updateByIdAsync(String policyAssignmentId, PolicyAssignmentUpdate parameters) { + return updateByIdWithResponseAsync(policyAssignmentId, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -663,93 +652,84 @@ public Mono getAsync(String scope, String policyAssignmen * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String policyAssignmentName, String expand, - Context context) { - return getWithResponseAsync(scope, policyAssignmentName, expand, context).block(); + public Response updateByIdWithResponse(String policyAssignmentId, + PolicyAssignmentUpdate parameters, Context context) { + return updateByIdWithResponseAsync(policyAssignmentId, parameters, context).block(); } /** - * Retrieves a policy assignment. - * - * This operation retrieves a single policy assignment, given its name and the scope it was created at. + * Updates a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: + * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all + * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies + * to all resources in the group. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: + * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription + * (format: '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment to get. + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner get(String scope, String policyAssignmentName) { - final String expand = null; - return getWithResponse(scope, policyAssignmentName, expand, Context.NONE).getValue(); + public PolicyAssignmentInner updateById(String policyAssignmentId, PolicyAssignmentUpdate parameters) { + return updateByIdWithResponse(policyAssignmentId, parameters, Context.NONE).getValue(); } /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters) { + public Mono> deleteByIdWithResponseAsync(String policyAssignmentId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, - parameters, accept, context)) + .withContext(context -> service.deleteById(this.client.getEndpoint(), policyAssignmentId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -757,71 +737,58 @@ public Mono> updateWithResponseAsync(String scop * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters, Context context) { + private Mono> deleteByIdWithResponseAsync(String policyAssignmentId, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (policyAssignmentName == null) { + if (policyAssignmentId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), scope, policyAssignmentName, apiVersion, parameters, accept, + return service.deleteById(this.client.getEndpoint(), policyAssignmentId, this.client.getApiVersion(), accept, context); } /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters) { - return updateWithResponseAsync(scope, policyAssignmentName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteByIdAsync(String policyAssignmentId) { + return deleteByIdWithResponseAsync(policyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Updates a policy assignment. - * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * Deletes a policy assignment. * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). + * + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -829,1012 +796,558 @@ public Mono updateAsync(String scope, String policyAssign * @return the policy assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String scope, String policyAssignmentName, - PolicyAssignmentUpdate parameters, Context context) { - return updateWithResponseAsync(scope, policyAssignmentName, parameters, context).block(); + public Response deleteByIdWithResponse(String policyAssignmentId, Context context) { + return deleteByIdWithResponseAsync(policyAssignmentId, context).block(); } /** - * Updates a policy assignment. + * Deletes a policy assignment. * - * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all - * resources contained within their scope. For example, when you assign a policy at resource group scope, that - * policy applies to all resources in the group. + * This operation deletes the policy with the given ID. Policy assignment IDs have this format: + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} + * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), + * '/subscriptions/{subscriptionId}' (subscription), + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' + * (resource). * - * @param scope The scope of the policy assignment. Valid scopes are: management group (format: - * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * @param policyAssignmentName The name of the policy assignment. - * @param parameters Parameters for policy assignment patch request. + * @param policyAssignmentId The ID of the policy assignment to get. Use the format + * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner update(String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters) { - return updateWithResponse(scope, policyAssignmentName, parameters, Context.NONE).getValue(); + public PolicyAssignmentInner deleteById(String policyAssignmentId) { + return deleteByIdWithResponse(policyAssignmentId, Context.NONE).getValue(); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String expand, Integer top) { + public Mono> getWithResponseAsync(String scope, String policyAssignmentName, + String expand) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (resourceGroupName == null) { + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, filter, expand, top, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, + policyAssignmentName, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String filter, String expand, Integer top, Context context) { + private Mono> getWithResponseAsync(String scope, String policyAssignmentName, + String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (resourceGroupName == null) { + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, filter, - expand, top, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. - * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand, Integer top) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, policyAssignmentName, expand, + accept, context); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String scope, String policyAssignmentName) { final String expand = null; - final Integer top = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); + return getWithResponseAsync(scope, policyAssignmentName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top, context), - nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, String policyAssignmentName, String expand, + Context context) { + return getWithResponseAsync(scope, policyAssignmentName, expand, context).block(); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation retrieves a single policy assignment, given its name and the scope it was created at. * - * @param resourceGroupName The name of the resource group that contains policy assignments. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. + * @return the policy assignment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyAssignmentInner get(String scope, String policyAssignmentName) { final String expand = null; - final Integer top = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top)); + return getWithResponse(scope, policyAssignmentName, expand, Context.NONE).getValue(); } /** - * Retrieves all policy assignments that apply to a resource group. - * - * This operation retrieves the list of all policy assignments associated with the given resource group in the given - * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy - * assignments associated with the resource group, including those that apply directly or apply from containing - * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is - * provided, the returned list includes all policy assignments that apply to the resource group, which is everything - * in the unfiltered list except those applied to resources contained within the resource group. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource - * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value} that apply to the resource group. + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param resourceGroupName The name of the resource group that contains policy assignments. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - String expand, Integer top, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top, context)); - } - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String filter, String expand, Integer top) { + public Mono> createWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (parentResourcePath == null) { + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listForResource(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, - expand, top, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), scope, + policyAssignmentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceSinglePageAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String filter, String expand, Integer top, Context context) { + private Mono> createWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (parentResourcePath == null) { + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listForResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, expand, top, - apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), scope, policyAssignmentName, + contentType, accept, parameters, context); } /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String filter, String expand, Integer top) { - return new PagedFlux<>( - () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, filter, expand, top), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters) { + return createWithResponseAsync(scope, policyAssignmentName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForResourceAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>( - () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, filter, expand, top), - nextLink -> listForResourceNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForResourceAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String filter, String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, filter, expand, top, context), - nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). - * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listForResourceAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, filter, expand, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String scope, String policyAssignmentName, + PolicyAssignmentInner parameters, Context context) { + return createWithResponseAsync(scope, policyAssignmentName, parameters, context).block(); } /** - * Retrieves all policy assignments that apply to a resource. - * - * This operation retrieves the list of all policy assignments associated with the specified resource in the given - * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', - * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes - * all policy assignments associated with the resource, including those that apply directly or from all containing - * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered - * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the - * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq - * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is - * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific - * resource. If the resource is not part of a parent resource (the more common case), the parent resource path - * should not be provided (or provided as ''). For example a web app could be specified as - * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', - * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be - * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == - * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', - * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately - * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', - * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + * This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to + * all resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param resourceGroupName The name of the resource group containing the resource. - * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual - * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). - * @param parentResourcePath The parent resource path. Use empty string if there is none. - * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). - * @param resourceName The name of the resource. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for the policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedIterable}. + * @return the policy assignment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForResource(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listForResourceAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, filter, expand, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters) { + return createWithResponse(scope, policyAssignmentName, parameters, Context.NONE).getValue(); } /** - * Retrieves all policy assignments that apply to a management group. - * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForManagementGroupSinglePageAsync(String managementGroupId, - String filter, String expand, Integer top) { + public Mono> updateWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupId == null) { + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listForManagementGroup(this.client.getEndpoint(), managementGroupId, filter, - expand, top, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), scope, + policyAssignmentName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy assignments that apply to a management group. - * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForManagementGroupSinglePageAsync(String managementGroupId, - String filter, String expand, Integer top, Context context) { + private Mono> updateWithResponseAsync(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters, 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) { + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (policyAssignmentName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listForManagementGroup(this.client.getEndpoint(), managementGroupId, filter, expand, top, apiVersion, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), scope, policyAssignmentName, + contentType, accept, parameters, context); } /** - * Retrieves all policy assignments that apply to a management group. - * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForManagementGroupAsync(String managementGroupId, String filter, - String expand, Integer top) { - return new PagedFlux<>(() -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top), - nextLink -> listForManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters) { + return updateWithResponseAsync(scope, policyAssignmentName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves all policy assignments that apply to a management group. + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String scope, String policyAssignmentName, + PolicyAssignmentUpdate parameters, Context context) { + return updateWithResponseAsync(scope, policyAssignmentName, parameters, context).block(); + } + + /** + * This operation updates a policy assignment with the given scope and name. Policy assignments apply to all + * resources contained within their scope. For example, when you assign a policy at resource group scope, that + * policy applies to all resources in the group. * - * @param managementGroupId The ID of the management group. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @param parameters Parameters for policy assignment patch request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listForManagementGroupAsync(String managementGroupId) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>(() -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top), - nextLink -> listForManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyAssignmentInner update(String scope, String policyAssignmentName, PolicyAssignmentUpdate parameters) { + return updateWithResponse(scope, policyAssignmentName, parameters, Context.NONE).getValue(); } /** - * Retrieves all policy assignments that apply to a management group. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWithResponseAsync(String scope, String policyAssignmentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (policyAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), scope, + policyAssignmentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listForManagementGroupAsync(String managementGroupId, String filter, - String expand, Integer top, Context context) { - return new PagedFlux<>( - () -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top, context), - nextLink -> listForManagementGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String scope, String policyAssignmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (policyAssignmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyAssignmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), scope, policyAssignmentName, + accept, context); } /** - * Retrieves all policy assignments that apply to a management group. - * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param managementGroupId The ID of the management group. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. + * @return the policy assignment on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForManagementGroup(String managementGroupId) { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listForManagementGroupAsync(managementGroupId, filter, expand, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAsync(String scope, String policyAssignmentName) { + return deleteWithResponseAsync(scope, policyAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves all policy assignments that apply to a management group. - * - * This operation retrieves the list of all policy assignments applicable to the management group that match the - * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. - * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the - * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list - * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is - * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that - * apply to the management group. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * @param managementGroupId The ID of the management group. - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' - * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() - * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything - * in the unfiltered list except those applied to sub scopes contained within the given scope. If - * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given - * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments - * of the policy definition whose id is {value}. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedIterable}. + * @return the policy assignment along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listForManagementGroup(String managementGroupId, String filter, - String expand, Integer top, Context context) { - return new PagedIterable<>(listForManagementGroupAsync(managementGroupId, filter, expand, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String scope, String policyAssignmentName, + Context context) { + return deleteWithResponseAsync(scope, policyAssignmentName, context).block(); } /** - * Retrieves all policy assignments that apply to a subscription. + * This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy + * assignment is the part of its ID preceding + * '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param policyAssignmentName The name of the policy assignment to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyAssignmentInner delete(String scope, String policyAssignmentName) { + return deleteWithResponse(scope, policyAssignmentName, Context.NONE).getValue(); + } + + /** + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -1848,10 +1361,12 @@ public PagedIterable listForManagementGroup(String manage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String expand, Integer top) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, String expand, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1860,30 +1375,32 @@ private Mono> listSinglePageAsync(String fi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), filter, expand, top, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -1898,11 +1415,12 @@ private Mono> listSinglePageAsync(String fi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String expand, Integer top, - Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter, String expand, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1911,30 +1429,32 @@ private Mono> listSinglePageAsync(String fi return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), filter, expand, top, apiVersion, this.client.getSubscriptionId(), accept, - context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -1948,55 +1468,55 @@ private Mono> listSinglePageAsync(String fi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, String expand, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); + public PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + String expand, Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String filter = null; final String expand = null; final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink)); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -2011,54 +1531,55 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedFlux}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String expand, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, + String expand, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top, context), + nextLink -> listForResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable listByResourceGroup(String resourceGroupName) { final String filter = null; final String expand = null; final Integer top = null; - return new PagedIterable<>(listAsync(filter, expand, top)); + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top)); } /** - * Retrieves all policy assignments that apply to a subscription. - * - * This operation retrieves the list of all policy assignments associated with the given subscription that match the - * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription, - * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the - * returned list includes all policy assignments that apply to the subscription, which is everything in the - * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is - * provided, the returned list only includes all policy assignments that at the subscription. If - * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the - * policy definition whose id is {value}. + * This operation retrieves the list of all policy assignments associated with the given resource group in the given + * subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy + * assignments associated with the resource group, including those that apply directly or apply from containing + * scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is + * provided, the returned list includes all policy assignments that apply to the resource group, which is everything + * in the unfiltered list except those applied to resources contained within the resource group. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource + * group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value} that apply to the resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything @@ -2073,632 +1594,964 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments as paginated response with {@link PagedIterable}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, expand, top, context)); + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + String expand, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top, context)); } /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param managementGroupId The management group ID. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteByIdWithResponseAsync(String policyAssignmentId) { + private Mono> listForManagementGroupSinglePageAsync(String managementGroupId, + String filter, String expand, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyAssignmentId == null) { + if (managementGroupId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteById(this.client.getEndpoint(), policyAssignmentId, apiVersion, accept, context)) + return FluxUtil + .withContext(context -> service.listForManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, filter, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param managementGroupId The management group ID. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteByIdWithResponseAsync(String policyAssignmentId, - Context context) { + private Mono> listForManagementGroupSinglePageAsync(String managementGroupId, + String filter, String expand, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyAssignmentId == null) { + if (managementGroupId == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteById(this.client.getEndpoint(), policyAssignmentId, apiVersion, accept, context); + return service + .listForManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, filter, + expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param managementGroupId The management group ID. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByIdAsync(String policyAssignmentId) { - return deleteByIdWithResponseAsync(policyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listForManagementGroupAsync(String managementGroupId, String filter, + String expand, Integer top) { + return new PagedFlux<>(() -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top), + nextLink -> listForManagementGroupNextSinglePageAsync(nextLink)); } /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param managementGroupId The management group 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 response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listForManagementGroupAsync(String managementGroupId) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>(() -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top), + nextLink -> listForManagementGroupNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all policy assignments that apply to a management group. + * + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. + * + * @param managementGroupId The management group ID. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteByIdWithResponse(String policyAssignmentId, Context context) { - return deleteByIdWithResponseAsync(policyAssignmentId, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForManagementGroupAsync(String managementGroupId, String filter, + String expand, Integer top, Context context) { + return new PagedFlux<>( + () -> listForManagementGroupSinglePageAsync(managementGroupId, filter, expand, top, context), + nextLink -> listForManagementGroupNextSinglePageAsync(nextLink, context)); } /** - * Deletes a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation deletes the policy with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} - * are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), - * '/subscriptions/{subscriptionId}' (subscription), - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' - * (resource). + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to delete. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param managementGroupId The management group 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 policy assignment. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner deleteById(String policyAssignmentId) { - return deleteByIdWithResponse(policyAssignmentId, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForManagementGroup(String managementGroupId) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listForManagementGroupAsync(managementGroupId, filter, expand, top)); } /** - * Creates or updates a policy assignment. + * Retrieves all policy assignments that apply to a management group. * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments applicable to the management group that match the + * given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. + * If $filter=atScope() is provided, the returned list includes all policy assignments that are assigned to the + * management group or the management group's ancestors. If $filter=atExactScope() is provided, the returned list + * only includes all policy assignments that at the management group. If $filter=policyDefinitionId eq '{value}' is + * provided, the returned list includes all policy assignments of the policy definition whose id is {value} that + * apply to the management group. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. + * @param managementGroupId The management group ID. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForManagementGroup(String managementGroupId, String filter, + String expand, Integer top, Context context) { + return new PagedIterable<>(listForManagementGroupAsync(managementGroupId, filter, expand, top, context)); + } + + /** + * Retrieves all policy assignments that apply to a subscription. + * + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. + * + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentInner parameters) { + private Mono> listSinglePageAsync(String filter, String expand, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createById(this.client.getEndpoint(), policyAssignmentId, apiVersion, - parameters, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy assignment. + * Retrieves all policy assignments that apply to a subscription. * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentInner parameters, Context context) { + private Mono> listSinglePageAsync(String filter, String expand, Integer top, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createById(this.client.getEndpoint(), policyAssignmentId, apiVersion, parameters, accept, - context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Creates or updates a policy assignment. + * Retrieves all policy assignments that apply to a subscription. * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters) { - return createByIdWithResponseAsync(policyAssignmentId, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createByIdWithResponse(String policyAssignmentId, - PolicyAssignmentInner parameters, Context context) { - return createByIdWithResponseAsync(policyAssignmentId, parameters, context).block(); - } - - /** - * Creates or updates a policy assignment. - * - * This operation creates or updates the policy assignment with the given ID. Policy assignments made on a scope - * apply to all resources contained in that scope. For example, when you assign a policy to a resource group that - * policy applies to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. - * - * @param policyAssignmentId The ID of the policy assignment to create. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters) { - return createByIdWithResponse(policyAssignmentId, parameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter, String expand, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Retrieves the policy assignment with the given ID. + * Retrieves all policy assignments that apply to a subscription. * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String policyAssignmentId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getById(this.client.getEndpoint(), policyAssignmentId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Retrieves the policy assignment with the given ID. + * Retrieves all policy assignments that apply to a subscription. * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String policyAssignmentId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getById(this.client.getEndpoint(), policyAssignmentId, apiVersion, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String expand, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Retrieves the policy assignment with the given ID. + * Retrieves all policy assignments that apply to a subscription. * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String policyAssignmentId) { - return getByIdWithResponseAsync(policyAssignmentId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, expand, top)); } /** - * Retrieves the policy assignment with the given ID. + * Retrieves all policy assignments that apply to a subscription. * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the given subscription that match the + * optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription, + * as well as any applied to objects contained within the subscription. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the subscription, which is everything in the + * unfiltered list except those applied to objects contained within the subscription. If $filter=atExactScope() is + * provided, the returned list only includes all policy assignments that at the subscription. If + * $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the + * policy definition whose id is {value}. * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String policyAssignmentId, Context context) { - return getByIdWithResponseAsync(policyAssignmentId, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String expand, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, expand, top, context)); } /** - * Retrieves the policy assignment with the given ID. + * Retrieves all policy assignments that apply to a resource. * - * The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to get. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner getById(String policyAssignmentId) { - return getByIdWithResponse(policyAssignmentId, Context.NONE).getValue(); + private Mono> listForResourceSinglePageAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String filter, String expand, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listForResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + this.client.getApiVersion(), filter, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentUpdate parameters) { + private Mono> listForResourceSinglePageAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String filter, String expand, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyAssignmentId == null) { + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updateById(this.client.getEndpoint(), policyAssignmentId, apiVersion, - parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + context = this.client.mergeContext(context); + return service + .listForResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, this.client.getApiVersion(), + filter, expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listForResourceAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String filter, String expand, Integer top) { + return new PagedFlux<>( + () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, filter, expand, top), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves all policy assignments that apply to a resource. + * + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateByIdWithResponseAsync(String policyAssignmentId, - PolicyAssignmentUpdate parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyAssignmentId == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyAssignmentId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateById(this.client.getEndpoint(), policyAssignmentId, apiVersion, parameters, accept, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listForResourceAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>( + () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, filter, expand, top), + nextLink -> listForResourceNextSinglePageAsync(nextLink)); } /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByIdAsync(String policyAssignmentId, PolicyAssignmentUpdate parameters) { - return updateByIdWithResponseAsync(policyAssignmentId, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForResourceAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String filter, String expand, Integer top, Context context) { + return new PagedFlux<>( + () -> listForResourceSinglePageAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, filter, expand, top, context), + nextLink -> listForResourceNextSinglePageAsync(nextLink, context)); } /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment along with {@link Response}. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateByIdWithResponse(String policyAssignmentId, - PolicyAssignmentUpdate parameters, Context context) { - return updateByIdWithResponseAsync(policyAssignmentId, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listForResourceAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, filter, expand, top)); } /** - * Updates a policy assignment. + * Retrieves all policy assignments that apply to a resource. * - * This operation updates the policy assignment with the given ID. Policy assignments made on a scope apply to all - * resources contained in that scope. For example, when you assign a policy to a resource group that policy applies - * to all resources in the group. Policy assignment IDs have this format: - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid scopes are: - * management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription - * (format: '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * This operation retrieves the list of all policy assignments associated with the specified resource in the given + * resource group and subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', + * 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes + * all policy assignments associated with the resource, including those that apply directly or from all containing + * scopes, as well as any applied to resources contained within the resource. If $filter=atScope() is provided, the + * returned list includes all policy assignments that apply to the resource, which is everything in the unfiltered + * list except those applied to resources contained within the resource. If $filter=atExactScope() is provided, the + * returned list only includes all policy assignments that at the resource level. If $filter=policyDefinitionId eq + * '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is + * {value} that apply to the resource. Three parameters plus the resource name are used to identify a specific + * resource. If the resource is not part of a parent resource (the more common case), the parent resource path + * should not be provided (or provided as ''). For example a web app could be specified as + * ({resourceProviderNamespace} == 'Microsoft.Web', {parentResourcePath} == '', {resourceType} == 'sites', + * {resourceName} == 'MyWebApp'). If the resource is part of a parent resource, then all parameters should be + * provided. For example a virtual machine DNS name could be specified as ({resourceProviderNamespace} == + * 'Microsoft.Compute', {parentResourcePath} == 'virtualMachines/MyVirtualMachine', {resourceType} == 'domainNames', + * {resourceName} == 'MyComputerName'). A convenient alternative to providing the namespace and type name separately + * is to provide both in the {resourceType} parameter, format: ({resourceProviderNamespace} == '', + * {parentResourcePath} == '', {resourceType} == 'Microsoft.Web/sites', {resourceName} == 'MyWebApp'). * - * @param policyAssignmentId The ID of the policy assignment to update. Use the format - * '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. - * @param parameters Parameters for policy assignment patch request. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. For example, the namespace of a virtual + * machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines). + * @param parentResourcePath The parent resource path. Use empty string if there is none. + * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from + * Microsoft.Web/sites). + * @param resourceName The name of the resource. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atScope()', 'atExactScope()' + * or 'policyDefinitionId eq '{value}''. If $filter is not provided, no filtering is performed. If $filter=atScope() + * is provided, the returned list only includes all policy assignments that apply to the scope, which is everything + * in the unfiltered list except those applied to sub scopes contained within the given scope. If + * $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given + * scope. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments + * of the policy definition whose id is {value}. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy assignment. + * @return the response of a PolicyAssignment list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyAssignmentInner updateById(String policyAssignmentId, PolicyAssignmentUpdate parameters) { - return updateByIdWithResponse(policyAssignmentId, parameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForResource(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String filter, String expand, Integer top, Context context) { + return new PagedIterable<>(listForResourceAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, filter, expand, top, context)); } /** - * Retrieves all policy assignments that apply to a resource group. - * * 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync(String nextLink) { @@ -2719,8 +2572,6 @@ private Mono> listForResourceGroupNextSingl } /** - * Retrieves all policy assignments that apply to a resource group. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2728,7 +2579,8 @@ private Mono> listForResourceGroupNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listForResourceGroupNextSinglePageAsync(String nextLink, @@ -2748,7 +2600,7 @@ private Mono> listForResourceGroupNextSingl } /** - * Retrieves all policy assignments that apply to a resource. + * Retrieves all policy assignments that apply to a management group. * * Get the next page of items. * @@ -2756,10 +2608,11 @@ private Mono> listForResourceGroupNextSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink) { + private Mono> listForManagementGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2769,14 +2622,15 @@ private Mono> listForResourceNextSinglePage } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context)) + .withContext( + context -> service.listForManagementGroupNext(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())); } /** - * Retrieves all policy assignments that apply to a resource. + * Retrieves all policy assignments that apply to a management group. * * Get the next page of items. * @@ -2785,10 +2639,11 @@ private Mono> listForResourceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForResourceNextSinglePageAsync(String nextLink, + private Mono> listForManagementGroupNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); @@ -2799,13 +2654,13 @@ private Mono> listForResourceNextSinglePage } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listForManagementGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves all policy assignments that apply to a management group. + * Retrieves all policy assignments that apply to a subscription. * * Get the next page of items. * @@ -2813,10 +2668,11 @@ private Mono> listForResourceNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForManagementGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2825,16 +2681,14 @@ private Mono> listForManagementGroupNextSin new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listForManagementGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + 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())); } /** - * Retrieves all policy assignments that apply to a management group. + * Retrieves all policy assignments that apply to a subscription. * * Get the next page of items. * @@ -2843,11 +2697,11 @@ private Mono> listForManagementGroupNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listForManagementGroupNextSinglePageAsync(String nextLink, - Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2857,13 +2711,13 @@ private Mono> listForManagementGroupNextSin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listForManagementGroupNext(nextLink, this.client.getEndpoint(), accept, 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)); } /** - * Retrieves all policy assignments that apply to a subscription. + * Retrieves all policy assignments that apply to a resource. * * Get the next page of items. * @@ -2871,10 +2725,11 @@ private Mono> listForManagementGroupNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listForResourceNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2883,14 +2738,15 @@ private Mono> listNextSinglePageAsync(Strin 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)) + return FluxUtil + .withContext(context -> service.listForResourceNext(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())); } /** - * Retrieves all policy assignments that apply to a subscription. + * Retrieves all policy assignments that apply to a resource. * * Get the next page of items. * @@ -2899,10 +2755,12 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy assignments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyAssignment list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listForResourceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -2912,7 +2770,7 @@ private Mono> listNextSinglePageAsync(Strin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listForResourceNext(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/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java index 4a9a44308d6e..662182df80bb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { PolicyClientImpl.class }) public final class PolicyClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the PolicyClientBuilder. */ - public PolicyClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public PolicyClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the PolicyClientBuilder. */ - public PolicyClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public PolicyClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public PolicyClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); PolicyClientImpl client = new PolicyClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, - localEnvironment, this.subscriptionId, localEndpoint); + localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java index 1ab2bbd7da45..4423a8ac58bb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; import com.azure.core.annotation.ServiceClient; @@ -25,32 +24,47 @@ */ @ServiceClient(builder = PolicyClientBuilder.class) public final class PolicyClientImpl extends AzureServiceClient implements PolicyClient { + /** - * The ID of the target subscription. The value must be an UUID. + * Service host. */ - private final String subscriptionId; + private final String endpoint; /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. + * Gets Service host. + * + * @return the endpoint value. */ - public String getSubscriptionId() { - return this.subscriptionId; + public String getEndpoint() { + return this.endpoint; } /** - * server parameter. + * Version parameter. */ - private final String endpoint; + private final String apiVersion; /** - * Gets server parameter. - * - * @return the endpoint value. + * Gets Version parameter. + * + * @return the apiVersion value. */ - public String getEndpoint() { - return this.endpoint; + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; } /** @@ -60,7 +74,7 @@ public String getEndpoint() { /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { @@ -74,7 +88,7 @@ public HttpPipeline getHttpPipeline() { /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { @@ -88,7 +102,7 @@ SerializerAdapter getSerializerAdapter() { /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { @@ -96,31 +110,31 @@ public Duration getDefaultPollInterval() { } /** - * The DataPolicyManifestsClient object to access its operations. + * The PolicyAssignmentsClient object to access its operations. */ - private final DataPolicyManifestsClient dataPolicyManifests; + private final PolicyAssignmentsClient policyAssignments; /** - * Gets the DataPolicyManifestsClient object to access its operations. - * - * @return the DataPolicyManifestsClient object. + * Gets the PolicyAssignmentsClient object to access its operations. + * + * @return the PolicyAssignmentsClient object. */ - public DataPolicyManifestsClient getDataPolicyManifests() { - return this.dataPolicyManifests; + public PolicyAssignmentsClient getPolicyAssignments() { + return this.policyAssignments; } /** - * The PolicyAssignmentsClient object to access its operations. + * The DataPolicyManifestsClient object to access its operations. */ - private final PolicyAssignmentsClient policyAssignments; + private final DataPolicyManifestsClient dataPolicyManifests; /** - * Gets the PolicyAssignmentsClient object to access its operations. - * - * @return the PolicyAssignmentsClient object. + * Gets the DataPolicyManifestsClient object to access its operations. + * + * @return the DataPolicyManifestsClient object. */ - public PolicyAssignmentsClient getPolicyAssignments() { - return this.policyAssignments; + public DataPolicyManifestsClient getDataPolicyManifests() { + return this.dataPolicyManifests; } /** @@ -130,7 +144,7 @@ public PolicyAssignmentsClient getPolicyAssignments() { /** * Gets the PolicyDefinitionsClient object to access its operations. - * + * * @return the PolicyDefinitionsClient object. */ public PolicyDefinitionsClient getPolicyDefinitions() { @@ -144,7 +158,7 @@ public PolicyDefinitionsClient getPolicyDefinitions() { /** * Gets the PolicyDefinitionVersionsClient object to access its operations. - * + * * @return the PolicyDefinitionVersionsClient object. */ public PolicyDefinitionVersionsClient getPolicyDefinitionVersions() { @@ -158,7 +172,7 @@ public PolicyDefinitionVersionsClient getPolicyDefinitionVersions() { /** * Gets the PolicySetDefinitionsClient object to access its operations. - * + * * @return the PolicySetDefinitionsClient object. */ public PolicySetDefinitionsClient getPolicySetDefinitions() { @@ -172,7 +186,7 @@ public PolicySetDefinitionsClient getPolicySetDefinitions() { /** * Gets the PolicySetDefinitionVersionsClient object to access its operations. - * + * * @return the PolicySetDefinitionVersionsClient object. */ public PolicySetDefinitionVersionsClient getPolicySetDefinitionVersions() { @@ -186,47 +200,34 @@ public PolicySetDefinitionVersionsClient getPolicySetDefinitionVersions() { /** * Gets the PolicyTokensClient object to access its operations. - * + * * @return the PolicyTokensClient object. */ public PolicyTokensClient getPolicyTokens() { return this.policyTokens; } - /** - * The PolicyExemptionsClient object to access its operations. - */ - private final PolicyExemptionsClient policyExemptions; - - /** - * Gets the PolicyExemptionsClient object to access its operations. - * - * @return the PolicyExemptionsClient object. - */ - public PolicyExemptionsClient getPolicyExemptions() { - return this.policyExemptions; - } - /** * Initializes an instance of PolicyClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ PolicyClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.dataPolicyManifests = new DataPolicyManifestsClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-11-01"; this.policyAssignments = new PolicyAssignmentsClientImpl(this); + this.dataPolicyManifests = new DataPolicyManifestsClientImpl(this); this.policyDefinitions = new PolicyDefinitionsClientImpl(this); this.policyDefinitionVersions = new PolicyDefinitionVersionsClientImpl(this); this.policySetDefinitions = new PolicySetDefinitionsClientImpl(this); @@ -234,4 +235,16 @@ public PolicyExemptionsClient getPolicyExemptions() { this.policyTokens = new PolicyTokensClientImpl(this); this.policyExemptions = new PolicyExemptionsClientImpl(this); } + + private final PolicyExemptionsClient policyExemptions; + + /** + * Gets the PolicyExemptionsClient object to access its operations. + * + * @return the PolicyExemptionsClient object. + */ + @Override + public PolicyExemptionsClient getPolicyExemptions() { + return this.policyExemptions; + } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionVersionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionVersionsClientImpl.java index 5aeb15775e00..34f9c5d6c2e0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionVersionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionVersionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -65,132 +65,127 @@ public final class PolicyDefinitionVersionsClientImpl * The interface defining all the services for PolicyClientPolicyDefinitionVersions to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientPolicyDefinitionVersions") public interface PolicyDefinitionVersionsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Authorization/listPolicyDefinitionVersions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllBuiltins(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllAtManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyDefinitionName") String policyDefinitionName, + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policyDefinitionName") String policyDefinitionName, @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyDefinitionVersionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyDefinitionVersionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policyDefinitionName") String policyDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyDefinitionName") String policyDefinitionName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuiltIn(@HostParam("$host") String endpoint, + Mono> getBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("policyDefinitionName") String policyDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("policyDefinitionName") String policyDefinitionName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, + @PathParam("policyDefinitionName") String policyDefinitionName, + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @HeaderParam("Accept") String accept, + Context context); + @Put("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdateAtManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupName") String managementGroupName, @PathParam("policyDefinitionName") String policyDefinitionName, @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyDefinitionVersionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyDefinitionVersionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupName") String managementGroupName, + Mono> deleteAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, @PathParam("policyDefinitionName") String policyDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions/{policyDefinitionVersion}") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup(@HostParam("$host") String endpoint, + Mono> listByManagementGroup( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, - @PathParam("policyDefinitionName") String policyDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionName") String policyDefinitionName, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") + @Post("/providers/Microsoft.Authorization/listPolicyDefinitionVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, Context context); + Mono> listAllBuiltins(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") + @Post("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicyDefinitionVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltIn(@HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, Context context); + Mono> listAllAtManagementGroup( + @HostParam("endpoint") String endpoint, @PathParam("managementGroupName") String managementGroupName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}/versions") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicyDefinitionVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, + Mono> listAll(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -198,7 +193,7 @@ Mono> listByManagementGroup( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -206,7 +201,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBuiltInNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -214,250 +209,64 @@ Mono> listBuiltInNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws 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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAllBuiltinsWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllBuiltins(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllBuiltinsWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAllBuiltins(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws 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 policy definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllBuiltinsAsync() { - return listAllBuiltinsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAllBuiltinsWithResponse(Context context) { - return listAllBuiltinsWithResponseAsync(context).block(); - } - - /** - * Lists all built-in policy definition versions. - * - * This operation lists all the built-in policy definition versions for all built-in policy definitions. - * - * @throws 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 policy definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionListResultInner listAllBuiltins() { - return listAllBuiltinsWithResponse(Context.NONE).getValue(); - } - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. + * This operation retrieves the policy definition version in the given subscription with the given name. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. + * @return the ID of the policy definition version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName) { + public Mono> getWithResponseAsync(String policyDefinitionName, + String policyDefinitionVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, - apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (managementGroupName == null) { + if (policyDefinitionName == null) { return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, apiVersion, accept, - context); - } - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllAtManagementGroupAsync(String managementGroupName) { - return listAllAtManagementGroupWithResponseAsync(managementGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - listAllAtManagementGroupWithResponse(String managementGroupName, Context context) { - return listAllAtManagementGroupWithResponseAsync(managementGroupName, context).block(); - } - - /** - * Lists all policy definition versions at management group scope. - * - * This operation lists all the policy definition versions for all policy definitions at the management group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName) { - return listAllAtManagementGroupWithResponse(managementGroupName, Context.NONE).getValue(); - } - - /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAllWithResponseAsync() { - if (this.client.getEndpoint() == null) { + if (policyDefinitionVersion == null) { return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAll(this.client.getEndpoint(), this.client.getSubscriptionId(), - apiVersion, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, policyDefinitionVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. + * This operation retrieves the policy definition version in the given subscription with the given name. * + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link Response} on successful completion of {@link Mono}. + * @return the ID of the policy definition version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllWithResponseAsync(Context context) { + private Mono> getWithResponseAsync(String policyDefinitionName, + String policyDefinitionVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -466,59 +275,72 @@ private Mono> listAllWithRespon return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listAll(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policyDefinitionName, policyDefinitionVersion, accept, context); } /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. + * This operation retrieves the policy definition version in the given subscription with the given name. * + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions on successful completion of {@link Mono}. + * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllAsync() { - return listAllWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAsync(String policyDefinitionName, String policyDefinitionVersion) { + return getWithResponseAsync(policyDefinitionName, policyDefinitionVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. + * This operation retrieves the policy definition version in the given subscription with the given name. * + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link Response}. + * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAllWithResponse(Context context) { - return listAllWithResponseAsync(context).block(); + public Response getWithResponse(String policyDefinitionName, + String policyDefinitionVersion, Context context) { + return getWithResponseAsync(policyDefinitionName, policyDefinitionVersion, context).block(); } /** - * Lists all policy definition versions within a subscription. - * - * This operation lists all the policy definition versions for all policy definitions within a subscription. + * This operation retrieves the policy definition version in the given subscription with the given name. * + * @param policyDefinitionName The name of the policy definition. + * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version + * number, y is the minor version number, and z is the patch number. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions. + * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionListResultInner listAll() { - return listAllWithResponse(Context.NONE).getValue(); + public PolicyDefinitionVersionInner get(String policyDefinitionName, String policyDefinitionVersion) { + return getWithResponse(policyDefinitionName, policyDefinitionVersion, Context.NONE).getValue(); } /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -555,17 +377,16 @@ public Mono> createOrUpdateWithResponseAs } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, policyDefinitionVersion, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -603,16 +424,15 @@ private Mono> createOrUpdateWithResponseA } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, - policyDefinitionVersion, apiVersion, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, policyDefinitionVersion, contentType, accept, + parameters, context); } /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -632,8 +452,6 @@ public Mono createOrUpdateAsync(String policyDefin } /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -654,8 +472,6 @@ public Response createOrUpdateWithResponse(String } /** - * Creates or updates a policy definition in a subscription. - * * This operation creates or updates a policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -675,8 +491,6 @@ public PolicyDefinitionVersionInner createOrUpdate(String policyDefinitionName, } /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -705,17 +519,13 @@ public Mono> deleteWithResponseAsync(String policyDefinitionName, return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, policyDefinitionVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -746,16 +556,12 @@ private Mono> deleteWithResponseAsync(String policyDefinitionName return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policyDefinitionName, policyDefinitionVersion, context); } /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -772,8 +578,6 @@ public Mono deleteAsync(String policyDefinitionName, String policyDefiniti } /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -792,8 +596,6 @@ public Response deleteWithResponse(String policyDefinitionName, String pol } /** - * Deletes a policy definition version in a subscription. - * * This operation deletes the policy definition version in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition. @@ -809,9 +611,161 @@ public void delete(String policyDefinitionName, String policyDefinitionVersion) } /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String policyDefinitionName, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String policyDefinitionName, + Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policyDefinitionName, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String policyDefinitionName, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String policyDefinitionName) { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String policyDefinitionName, Integer top, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String policyDefinitionName) { + final Integer top = null; + return new PagedIterable<>(listAsync(policyDefinitionName, top)); + } + + /** + * This operation retrieves a list of all the policy definition versions for the given policy definition. + * + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String policyDefinitionName, Integer top, Context context) { + return new PagedIterable<>(listAsync(policyDefinitionName, top, context)); + } + + /** + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -823,16 +777,12 @@ public void delete(String policyDefinitionName, String policyDefinitionVersion) * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String policyDefinitionName, + public Mono> getBuiltInWithResponseAsync(String policyDefinitionName, String policyDefinitionVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); @@ -841,18 +791,15 @@ public Mono> getWithResponseAsync(String return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policyDefinitionName, policyDefinitionVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -865,16 +812,12 @@ public Mono> getWithResponseAsync(String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String policyDefinitionName, + private Mono> getBuiltInWithResponseAsync(String policyDefinitionName, String policyDefinitionVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); @@ -883,17 +826,14 @@ private Mono> getWithResponseAsync(String return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policyDefinitionName, + policyDefinitionVersion, accept, context); } /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -904,15 +844,14 @@ private Mono> getWithResponseAsync(String * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String policyDefinitionName, String policyDefinitionVersion) { - return getWithResponseAsync(policyDefinitionName, policyDefinitionVersion) + public Mono getBuiltInAsync(String policyDefinitionName, + String policyDefinitionVersion) { + return getBuiltInWithResponseAsync(policyDefinitionName, policyDefinitionVersion) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -924,15 +863,13 @@ public Mono getAsync(String policyDefinitionName, * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String policyDefinitionName, + public Response getBuiltInWithResponse(String policyDefinitionName, String policyDefinitionVersion, Context context) { - return getWithResponseAsync(policyDefinitionName, policyDefinitionVersion, context).block(); + return getBuiltInWithResponseAsync(policyDefinitionName, policyDefinitionVersion, context).block(); } /** - * Retrieves a policy definition version in a subscription. - * - * This operation retrieves the policy definition version in the given subscription with the given name. + * This operation retrieves the built-in policy definition version with the given name. * * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version @@ -943,27 +880,24 @@ public Response getWithResponse(String policyDefin * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionInner get(String policyDefinitionName, String policyDefinitionVersion) { - return getWithResponse(policyDefinitionName, policyDefinitionVersion, Context.NONE).getValue(); + public PolicyDefinitionVersionInner getBuiltIn(String policyDefinitionName, String policyDefinitionVersion) { + return getBuiltInWithResponse(policyDefinitionName, policyDefinitionVersion, Context.NONE).getValue(); } /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBuiltInWithResponseAsync(String policyDefinitionName, - String policyDefinitionVersion) { + private Mono> listBuiltInSinglePageAsync(String policyDefinitionName, + Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -972,36 +906,30 @@ public Mono> getBuiltInWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), policyDefinitionName, - policyDefinitionVersion, apiVersion, accept, context)) + .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policyDefinitionName, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBuiltInWithResponseAsync(String policyDefinitionName, - String policyDefinitionVersion, Context context) { + private Mono> listBuiltInSinglePageAsync(String policyDefinitionName, + Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1010,85 +938,106 @@ private Mono> getBuiltInWithResponseAsync return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getBuiltIn(this.client.getEndpoint(), policyDefinitionName, policyDefinitionVersion, apiVersion, - accept, context); + return service + .listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policyDefinitionName, top, accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version on successful completion of {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuiltInAsync(String policyDefinitionName, - String policyDefinitionVersion) { - return getBuiltInWithResponseAsync(policyDefinitionName, policyDefinitionVersion) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top) { + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); } /** - * Retrieves a built-in policy definition version. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * - * This operation retrieves the built-in policy definition version with the given name. + * @param policyDefinitionName The name of the policy definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBuiltInAsync(String policyDefinitionName) { + final Integer top = null; + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuiltInWithResponse(String policyDefinitionName, - String policyDefinitionVersion, Context context) { - return getBuiltInWithResponseAsync(policyDefinitionName, policyDefinitionVersion, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top, + Context context) { + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top, context), + nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); } /** - * Retrieves a built-in policy definition version. - * - * This operation retrieves the built-in policy definition version with the given name. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * * @param policyDefinitionName The name of the policy definition. - * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version - * number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionInner getBuiltIn(String policyDefinitionName, String policyDefinitionVersion) { - return getBuiltInWithResponse(policyDefinitionName, policyDefinitionVersion, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuiltIn(String policyDefinitionName) { + final Integer top = null; + return new PagedIterable<>(listBuiltInAsync(policyDefinitionName, top)); } /** - * Creates or updates a policy definition version in a management group. + * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. * - * This operation creates or updates a policy definition version in the given management group with the given name. + * @param policyDefinitionName The name of the policy definition. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuiltIn(String policyDefinitionName, Integer top, + Context context) { + return new PagedIterable<>(listBuiltInAsync(policyDefinitionName, top, context)); + } + + /** + * This operation retrieves the policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. - * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1096,9 +1045,8 @@ public PolicyDefinitionVersionInner getBuiltIn(String policyDefinitionName, Stri * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, - PolicyDefinitionVersionInner parameters) { + public Mono> getAtManagementGroupWithResponseAsync( + String managementGroupName, String policyDefinitionName, String policyDefinitionVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1115,30 +1063,20 @@ public Mono> createOrUpdateAtManagementGr return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policyDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context)) + .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policyDefinitionName, policyDefinitionVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy definition version in a management group. - * - * This operation creates or updates a policy definition version in the given management group with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. - * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1147,9 +1085,8 @@ public Mono> createOrUpdateAtManagementGr * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, - PolicyDefinitionVersionInner parameters, Context context) { + private Mono> getAtManagementGroupWithResponseAsync( + String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1166,50 +1103,38 @@ private Mono> createOrUpdateAtManagementG return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policyDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context); + return service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupName, + policyDefinitionName, policyDefinitionVersion, accept, context); } /** - * Creates or updates a policy definition version in a management group. - * - * This operation creates or updates a policy definition version in the given management group with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. - * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, - policyDefinitionVersion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAtManagementGroupAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion) { + return getAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, policyDefinitionVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a policy definition version in a management group. - * - * This operation creates or updates a policy definition version in the given management group with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. - * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1217,52 +1142,49 @@ public Mono createOrUpdateAtManagementGroupAsync(S * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtManagementGroupWithResponse( - String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, - PolicyDefinitionVersionInner parameters, Context context) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, - policyDefinitionVersion, parameters, context).block(); + public Response getAtManagementGroupWithResponse(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion, Context context) { + return getAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, policyDefinitionVersion, + context).block(); } /** - * Creates or updates a policy definition version in a management group. - * - * This operation creates or updates a policy definition version in the given management group with the given name. + * This operation retrieves the policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. - * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionInner createOrUpdateAtManagementGroup(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters) { - return createOrUpdateAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, - policyDefinitionVersion, parameters, Context.NONE).getValue(); + public PolicyDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policyDefinitionName, + String policyDefinitionVersion) { + return getAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, policyDefinitionVersion, + Context.NONE).getValue(); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the ID of the policy definition version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion) { + public Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, + PolicyDefinitionVersionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1279,32 +1201,39 @@ public Mono> deleteAtManagementGroupWithResponseAsync(String mana return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policyDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupName, policyDefinitionName, policyDefinitionVersion, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. + * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the ID of the policy definition version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion, Context context) { + private Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, + PolicyDefinitionVersionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1321,80 +1250,83 @@ private Mono> deleteAtManagementGroupWithResponseAsync(String man return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupName, policyDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policyDefinitionName, policyDefinitionVersion, contentType, accept, parameters, + context); } - /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + /** + * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the ID of the policy definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String managementGroupName, String policyDefinitionName, - String policyDefinitionVersion) { - return deleteAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, - policyDefinitionVersion).flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAtManagementGroupAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, + policyDefinitionVersion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. + * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the ID of the policy definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtManagementGroupWithResponse(String managementGroupName, String policyDefinitionName, - String policyDefinitionVersion, Context context) { - return deleteAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, - policyDefinitionVersion, context).block(); + public Response createOrUpdateAtManagementGroupWithResponse( + String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, + PolicyDefinitionVersionInner parameters, Context context) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, + policyDefinitionVersion, parameters, context).block(); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation creates or updates a policy definition version in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param policyDefinitionVersion The policy definition version. The format is x.y.z where x is the major version * number, y is the minor version number, and z is the patch number. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String managementGroupName, String policyDefinitionName, - String policyDefinitionVersion) { - deleteAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, policyDefinitionVersion, - Context.NONE); + public PolicyDefinitionVersionInner createOrUpdateAtManagementGroup(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion, PolicyDefinitionVersionInner parameters) { + return createOrUpdateAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, + policyDefinitionVersion, parameters, Context.NONE).getValue(); } /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. @@ -1403,12 +1335,11 @@ public void deleteAtManagementGroup(String managementGroupName, String policyDef * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupWithResponseAsync( - String managementGroupName, String policyDefinitionName, String policyDefinitionVersion) { + public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1425,18 +1356,15 @@ public Mono> getAtManagementGroupWithResp return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policyDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext( + context -> service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policyDefinitionName, policyDefinitionVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. @@ -1446,12 +1374,11 @@ public Mono> getAtManagementGroupWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupWithResponseAsync( - String managementGroupName, String policyDefinitionName, String policyDefinitionVersion, Context context) { + private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupName, + String policyDefinitionName, String policyDefinitionVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1468,17 +1395,13 @@ private Mono> getAtManagementGroupWithRes return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroup(this.client.getEndpoint(), managementGroupName, policyDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policyDefinitionName, policyDefinitionVersion, context); } /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. @@ -1487,19 +1410,17 @@ private Mono> getAtManagementGroupWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupAsync(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion) { - return getAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, policyDefinitionVersion) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAtManagementGroupAsync(String managementGroupName, String policyDefinitionName, + String policyDefinitionVersion) { + return deleteAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, + policyDefinitionVersion).flatMap(ignored -> Mono.empty()); } /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. @@ -1509,19 +1430,17 @@ public Mono getAtManagementGroupAsync(String manag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupWithResponse(String managementGroupName, - String policyDefinitionName, String policyDefinitionVersion, Context context) { - return getAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, policyDefinitionVersion, - context).block(); + public Response deleteAtManagementGroupWithResponse(String managementGroupName, String policyDefinitionName, + String policyDefinitionVersion, Context context) { + return deleteAtManagementGroupWithResponseAsync(managementGroupName, policyDefinitionName, + policyDefinitionVersion, context).block(); } /** - * Retrieve a policy definition version in a management group. - * - * This operation retrieves the policy definition version in the given management group with the given name. + * This operation deletes the policy definition in the given management group with the given name. * * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. @@ -1530,360 +1449,293 @@ public Response getAtManagementGroupWithResponse(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ID of the policy definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionVersionInner getAtManagementGroup(String managementGroupName, String policyDefinitionName, + public void deleteAtManagementGroup(String managementGroupName, String policyDefinitionName, String policyDefinitionVersion) { - return getAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, policyDefinitionVersion, - Context.NONE).getValue(); + deleteAtManagementGroupWithResponse(managementGroupName, policyDefinitionName, policyDefinitionVersion, + Context.NONE); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String policyDefinitionName, - Integer top) { + private Mono> + listByManagementGroupSinglePageAsync(String managementGroupName, String policyDefinitionName, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } if (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, apiVersion, top, accept, context)) + .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupName, policyDefinitionName, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String policyDefinitionName, - Integer top, Context context) { + private Mono> listByManagementGroupSinglePageAsync( + String managementGroupName, String policyDefinitionName, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } if (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, apiVersion, top, - accept, context) + .listByManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupName, + policyDefinitionName, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String policyDefinitionName, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); + public PagedFlux listByManagementGroupAsync(String managementGroupName, + String policyDefinitionName, Integer top) { + return new PagedFlux<>( + () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top), + nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String policyDefinitionName) { + public PagedFlux listByManagementGroupAsync(String managementGroupName, + String policyDefinitionName) { final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>( + () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top), + nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String policyDefinitionName, Integer top, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(policyDefinitionName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listByManagementGroupAsync(String managementGroupName, + String policyDefinitionName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top, context), + nextLink -> listByManagementGroupNextSinglePageAsync(nextLink, context)); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String policyDefinitionName) { + public PagedIterable listByManagementGroup(String managementGroupName, + String policyDefinitionName) { final Integer top = null; - return new PagedIterable<>(listAsync(policyDefinitionName, top)); + return new PagedIterable<>(listByManagementGroupAsync(managementGroupName, policyDefinitionName, top)); } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * - * This operation retrieves a list of all the policy definition versions for the given policy definition. + * This operation retrieves a list of all the policy definition versions for the given policy definition in the + * given management group. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policyDefinitionName The name of the policy definition. * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String policyDefinitionName, Integer top, Context context) { - return new PagedIterable<>(listAsync(policyDefinitionName, top, context)); - } - - /** - * Retrieve built-in policy definition versions - * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. - * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync(String policyDefinitionName, - Integer top) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), policyDefinitionName, apiVersion, - top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieve built-in policy definition versions - * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. - * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync(String policyDefinitionName, - Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBuiltIn(this.client.getEndpoint(), policyDefinitionName, apiVersion, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public PagedIterable listByManagementGroup(String managementGroupName, + String policyDefinitionName, Integer top, Context context) { + return new PagedIterable<>(listByManagementGroupAsync(managementGroupName, policyDefinitionName, top, context)); } /** - * Retrieve built-in policy definition versions - * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * Lists all built-in policy definition versions. + * + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAllBuiltinsWithResponseAsync() { + 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.listAllBuiltins(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve built-in policy definition versions + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync(String policyDefinitionName) { - final Integer top = null; - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllBuiltinsWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAllBuiltins(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** - * Retrieve built-in policy definition versions + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBuiltInAsync(String policyDefinitionName, Integer top, - Context context) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policyDefinitionName, top, context), - nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAllBuiltinsAsync() { + return listAllBuiltinsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieve built-in policy definition versions + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(String policyDefinitionName) { - final Integer top = null; - return new PagedIterable<>(listBuiltInAsync(policyDefinitionName, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAllBuiltinsWithResponse(Context context) { + return listAllBuiltinsWithResponseAsync(context).block(); } /** - * Retrieve built-in policy definition versions + * Lists all built-in policy definition versions. * - * This operation retrieves a list of all the built-in policy definition versions for the given policy definition. + * This operation lists all the built-in policy definition versions for all built-in policy definitions. * - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(String policyDefinitionName, Integer top, - Context context) { - return new PagedIterable<>(listBuiltInAsync(policyDefinitionName, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyDefinitionVersionListResultInner listAllBuiltins() { + return listAllBuiltinsWithResponse(Context.NONE).getValue(); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByManagementGroupSinglePageAsync(String managementGroupName, String policyDefinitionName, Integer top) { + public Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1892,39 +1744,29 @@ public PagedIterable listBuiltIn(String policyDefi return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), managementGroupName, - policyDefinitionName, apiVersion, top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupSinglePageAsync( - String managementGroupName, String policyDefinitionName, Integer top, Context context) { + private Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1933,139 +1775,171 @@ private Mono> listByManagementGroupS return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByManagementGroup(this.client.getEndpoint(), managementGroupName, policyDefinitionName, apiVersion, - top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), accept, context); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByManagementGroupAsync(String managementGroupName, - String policyDefinitionName, Integer top) { - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAllAtManagementGroupAsync(String managementGroupName) { + return listAllAtManagementGroupWithResponseAsync(managementGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByManagementGroupAsync(String managementGroupName, - String policyDefinitionName) { - final Integer top = null; - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + listAllAtManagementGroupWithResponse(String managementGroupName, Context context) { + return listAllAtManagementGroupWithResponseAsync(managementGroupName, context).block(); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions at management group scope. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions at the management group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByManagementGroupAsync(String managementGroupName, - String policyDefinitionName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupName, policyDefinitionName, top, context), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName) { + return listAllAtManagementGroupWithResponse(managementGroupName, Context.NONE).getValue(); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAllWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAll(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all policy definition versions within a subscription. + * + * This operation lists all the policy definition versions for all policy definitions within a subscription. + * + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupName, - String policyDefinitionName) { - final Integer top = null; - return new PagedIterable<>(listByManagementGroupAsync(managementGroupName, policyDefinitionName, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAllWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAll(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context); } /** - * Retrieve policy definition versions in a management group policy definition. + * Lists all policy definition versions within a subscription. * - * This operation retrieves a list of all the policy definition versions for the given policy definition in the - * given management group. + * This operation lists all the policy definition versions for all policy definitions within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAllAsync() { + return listAllWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all policy definition versions within a subscription. + * + * This operation lists all the policy definition versions for all policy definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policyDefinitionName The name of the policy definition. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupName, - String policyDefinitionName, Integer top, Context context) { - return new PagedIterable<>(listByManagementGroupAsync(managementGroupName, policyDefinitionName, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAllWithResponse(Context context) { + return listAllWithResponseAsync(context).block(); } /** - * Retrieves policy definition versions for a given policy definition in a subscription + * Lists all policy definition versions within a subscription. + * + * This operation lists all the policy definition versions for all policy definitions within a subscription. * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinitionVersion list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyDefinitionVersionListResultInner listAll() { + return listAllWithResponse(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 list of policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2084,8 +1958,6 @@ private Mono> listNextSinglePageAsyn } /** - * Retrieves policy definition versions for a given policy definition in a subscription - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2093,8 +1965,8 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, @@ -2114,16 +1986,14 @@ private Mono> listNextSinglePageAsyn } /** - * Retrieve built-in policy definition versions - * * 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink) { @@ -2143,8 +2013,6 @@ private Mono> listBuiltInNextSingleP } /** - * Retrieve built-in policy definition versions - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2152,8 +2020,8 @@ private Mono> listBuiltInNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink, @@ -2173,16 +2041,14 @@ private Mono> listBuiltInNextSingleP } /** - * Retrieve policy definition versions in a management group policy definition. - * * 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -2204,8 +2070,6 @@ private Mono> listBuiltInNextSingleP } /** - * Retrieve policy definition versions in a management group policy definition. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2213,8 +2077,8 @@ private Mono> listBuiltInNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicyDefinitionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java index d52920f00fec..3007f577feea 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.PolicyDefinitionsClient; import com.azure.resourcemanager.resources.fluent.models.PolicyDefinitionInner; -import com.azure.resourcemanager.resources.models.PolicyDefinitionListResult; +import com.azure.resourcemanager.resources.implementation.models.PolicyDefinitionListResult; import reactor.core.publisher.Mono; /** @@ -62,107 +62,102 @@ public final class PolicyDefinitionsClientImpl implements PolicyDefinitionsClien * The interface defining all the services for PolicyClientPolicyDefinitions to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientPolicyDefinitions") public interface PolicyDefinitionsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyDefinitionName") String policyDefinitionName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyDefinitionInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyDefinitionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policyDefinitionName") String policyDefinitionName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuiltIn(@HostParam("$host") String endpoint, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("policyDefinitionName") String policyDefinitionName, + Mono> getBuiltIn(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicyDefinitionInner parameters, @HeaderParam("Accept") String accept, + @PathParam("policyDefinitionName") String policyDefinitionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") - @ExpectedResponses({ 200, 204 }) + @Get("/providers/Microsoft.Authorization/policyDefinitions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("policyDefinitionName") String policyDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> getAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("policyDefinitionName") String policyDefinitionName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions") - @ExpectedResponses({ 200 }) + @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdateAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("policyDefinitionName") String policyDefinitionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyDefinitionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Authorization/policyDefinitions") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltIn(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam(value = "$filter", encoded = true) String filter, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + Mono> deleteAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("policyDefinitionName") String policyDefinitionName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroup(@HostParam("$host") String endpoint, + Mono> listByManagementGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -170,7 +165,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBuiltInNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -178,25 +173,21 @@ Mono> listBuiltInNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Creates or updates a policy definition in a subscription. - * - * This operation creates or updates a policy definition in the given subscription with the given name. + * This operation retrieves the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String policyDefinitionName, - PolicyDefinitionInner parameters) { + public Mono> getWithResponseAsync(String policyDefinitionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -209,26 +200,17 @@ public Mono> createOrUpdateWithResponseAsync(Str return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, apiVersion, parameters, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy definition in a subscription. - * - * This operation creates or updates a policy definition in the given subscription with the given name. + * This operation retrieves the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -236,8 +218,7 @@ public Mono> createOrUpdateWithResponseAsync(Str * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String policyDefinitionName, - PolicyDefinitionInner parameters, Context context) { + private Mono> getWithResponseAsync(String policyDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -250,44 +231,30 @@ private Mono> createOrUpdateWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, - apiVersion, parameters, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policyDefinitionName, accept, context); } /** - * Creates or updates a policy definition in a subscription. - * - * This operation creates or updates a policy definition in the given subscription with the given name. + * This operation retrieves the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String policyDefinitionName, - PolicyDefinitionInner parameters) { - return createOrUpdateWithResponseAsync(policyDefinitionName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAsync(String policyDefinitionName) { + return getWithResponseAsync(policyDefinitionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a policy definition in a subscription. - * - * This operation creates or updates a policy definition in the given subscription with the given name. + * This operation retrieves the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -295,41 +262,37 @@ public Mono createOrUpdateAsync(String policyDefinitionNa * @return the policy definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String policyDefinitionName, - PolicyDefinitionInner parameters, Context context) { - return createOrUpdateWithResponseAsync(policyDefinitionName, parameters, context).block(); + public Response getWithResponse(String policyDefinitionName, Context context) { + return getWithResponseAsync(policyDefinitionName, context).block(); } /** - * Creates or updates a policy definition in a subscription. - * - * This operation creates or updates a policy definition in the given subscription with the given name. + * This operation retrieves the policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) { - return createOrUpdateWithResponse(policyDefinitionName, parameters, Context.NONE).getValue(); + public PolicyDefinitionInner get(String policyDefinitionName) { + return getWithResponse(policyDefinitionName, Context.NONE).getValue(); } /** - * Deletes a policy definition in a subscription. - * - * This operation deletes the policy definition in the given subscription with the given name. + * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String policyDefinitionName) { + public Mono> createOrUpdateWithResponseAsync(String policyDefinitionName, + PolicyDefinitionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -342,28 +305,33 @@ public Mono> deleteWithResponseAsync(String policyDefinitionName) return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, apiVersion, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy definition in a subscription. - * - * This operation deletes the policy definition in the given subscription with the given name. + * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String policyDefinitionName, Context context) { + private Mono> createOrUpdateWithResponseAsync(String policyDefinitionName, + PolicyDefinitionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -376,74 +344,78 @@ private Mono> deleteWithResponseAsync(String policyDefinitionName return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, - apiVersion, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, contentType, accept, parameters, context); } /** - * Deletes a policy definition in a subscription. - * - * This operation deletes the policy definition in the given subscription with the given name. + * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the policy definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String policyDefinitionName) { - return deleteWithResponseAsync(policyDefinitionName).flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAsync(String policyDefinitionName, + PolicyDefinitionInner parameters) { + return createOrUpdateWithResponseAsync(policyDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a policy definition in a subscription. - * - * This operation deletes the policy definition in the given subscription with the given name. + * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the policy definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String policyDefinitionName, Context context) { - return deleteWithResponseAsync(policyDefinitionName, context).block(); + public Response createOrUpdateWithResponse(String policyDefinitionName, + PolicyDefinitionInner parameters, Context context) { + return createOrUpdateWithResponseAsync(policyDefinitionName, parameters, context).block(); } /** - * Deletes a policy definition in a subscription. - * - * This operation deletes the policy definition in the given subscription with the given name. + * This operation creates or updates a policy definition in the given subscription with the given name. * - * @param policyDefinitionName The name of the policy definition to delete. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String policyDefinitionName) { - deleteWithResponse(policyDefinitionName, Context.NONE); + public PolicyDefinitionInner createOrUpdate(String policyDefinitionName, PolicyDefinitionInner parameters) { + return createOrUpdateWithResponse(policyDefinitionName, parameters, Context.NONE).getValue(); } /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String policyDefinitionName) { + public Mono> deleteWithResponseAsync(String policyDefinitionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -456,28 +428,24 @@ public Mono> getWithResponseAsync(String policyD return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - policyDefinitionName, apiVersion, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policyDefinitionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String policyDefinitionName, Context context) { + private Mono> deleteWithResponseAsync(String policyDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -490,217 +458,307 @@ private Mono> getWithResponseAsync(String policy return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), policyDefinitionName, apiVersion, - accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policyDefinitionName, context); } /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String policyDefinitionName) { - return getWithResponseAsync(policyDefinitionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String policyDefinitionName) { + return deleteWithResponseAsync(policyDefinitionName).flatMap(ignored -> Mono.empty()); } /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String policyDefinitionName, Context context) { - return getWithResponseAsync(policyDefinitionName, context).block(); + public Response deleteWithResponse(String policyDefinitionName, Context context) { + return deleteWithResponseAsync(policyDefinitionName, context).block(); } /** - * Retrieves a policy definition in a subscription. - * - * This operation retrieves the policy definition in the given subscription with the given name. + * This operation deletes the policy definition in the given subscription with the given name. * * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner get(String policyDefinitionName) { - return getWithResponse(policyDefinitionName, Context.NONE).getValue(); + public void delete(String policyDefinitionName) { + deleteWithResponse(policyDefinitionName, Context.NONE); } /** - * Retrieves a built-in policy definition. - * - * This operation retrieves the built-in policy definition with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the built-in policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBuiltInWithResponseAsync(String policyDefinitionName) { + private Mono> listSinglePageAsync(String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getBuiltIn(this.client.getEndpoint(), policyDefinitionName, apiVersion, accept, context)) + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a built-in policy definition. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * This operation retrieves the built-in policy definition with the given name. - * - * @param policyDefinitionName The name of the built-in policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBuiltInWithResponseAsync(String policyDefinitionName, + private Mono> listSinglePageAsync(String filter, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getBuiltIn(this.client.getEndpoint(), policyDefinitionName, apiVersion, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, top, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves a built-in policy definition. - * - * This operation retrieves the built-in policy definition with the given name. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the built-in policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuiltInAsync(String policyDefinitionName) { - return getBuiltInWithResponseAsync(policyDefinitionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Retrieves a built-in policy definition. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * This operation retrieves the built-in policy definition with the given name. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the built-in policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition along with {@link Response}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuiltInWithResponse(String policyDefinitionName, Context context) { - return getBuiltInWithResponseAsync(policyDefinitionName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Retrieves a built-in policy definition. + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * This operation retrieves the built-in policy definition with the given name. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * This operation retrieves a list of all the policy definitions in a given subscription that match the optional + * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq + * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the + * subscription, including those that apply directly or from management groups that contain the given subscription. + * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy + * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and + * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions + * whose category match the {value}. * - * @param policyDefinitionName The name of the built-in policy definition to get. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy definition. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner getBuiltIn(String policyDefinitionName) { - return getBuiltInWithResponse(policyDefinitionName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); } /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves the built-in policy definition with the given name. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the built-in policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupId, String policyDefinitionName, PolicyDefinitionInner parameters) { + public Mono> getBuiltInWithResponseAsync(String policyDefinitionName) { 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 (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), - managementGroupId, policyDefinitionName, apiVersion, parameters, accept, context)) + .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policyDefinitionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves the built-in policy definition with the given name. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the built-in policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -708,60 +766,40 @@ public Mono> createOrUpdateAtManagementGroupWith * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupId, String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { + private Mono> getBuiltInWithResponseAsync(String policyDefinitionName, + 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 (policyDefinitionName == null) { return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policyDefinitionName, apiVersion, parameters, accept, context); + return service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policyDefinitionName, accept, + context); } /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves the built-in policy definition with the given name. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the built-in policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String policyDefinitionName, PolicyDefinitionInner parameters) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getBuiltInAsync(String policyDefinitionName) { + return getBuiltInWithResponseAsync(policyDefinitionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves the built-in policy definition with the given name. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the built-in policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -769,158 +807,213 @@ public Mono createOrUpdateAtManagementGroupAsync(String m * @return the policy definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, - String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, parameters, - context).block(); + public Response getBuiltInWithResponse(String policyDefinitionName, Context context) { + return getBuiltInWithResponseAsync(policyDefinitionName, context).block(); } /** - * Creates or updates a policy definition in a management group. - * - * This operation creates or updates a policy definition in the given management group with the given name. + * This operation retrieves the built-in policy definition with the given name. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to create. - * @param parameters The policy definition properties. + * @param policyDefinitionName The name of the built-in policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicyDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policyDefinitionName, - PolicyDefinitionInner parameters) { - return createOrUpdateAtManagementGroupWithResponse(managementGroupId, policyDefinitionName, parameters, - Context.NONE).getValue(); + public PolicyDefinitionInner getBuiltIn(String policyDefinitionName) { + return getBuiltInWithResponse(policyDefinitionName, Context.NONE).getValue(); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String policyDefinitionName) { + private Mono> listBuiltInSinglePageAsync(String filter, Integer top) { 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 (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policyDefinitionName, apiVersion, accept, context)) + .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), filter, + top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String policyDefinitionName, Context context) { + private Mono> listBuiltInSinglePageAsync(String filter, Integer top, + 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 (policyDefinitionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupId, policyDefinitionName, - apiVersion, accept, context); + return service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), filter, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. + * + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBuiltInAsync(String filter, Integer top) { + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String managementGroupId, String policyDefinitionName) { - return deleteAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName) - .flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBuiltInAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); } /** - * Deletes a policy definition in a management group. - * - * This operation deletes the policy definition in the given management group with the given name. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtManagementGroupWithResponse(String managementGroupId, String policyDefinitionName, - Context context) { - return deleteAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuiltInAsync(String filter, Integer top, Context context) { + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top, context), + nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); } /** - * Deletes a policy definition in a management group. + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * This operation deletes the policy definition in the given management group with the given name. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuiltIn() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listBuiltInAsync(filter, top)); + } + + /** + * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If + * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose + * category match the {value}. * - * @param managementGroupId The ID of the management group. - * @param policyDefinitionName The name of the policy definition to delete. + * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType + * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If + * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given + * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions + * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If + * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category + * match the {value}. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String managementGroupId, String policyDefinitionName) { - deleteAtManagementGroupWithResponse(managementGroupId, policyDefinitionName, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuiltIn(String filter, Integer top, Context context) { + return new PagedIterable<>(listBuiltInAsync(filter, top, context)); } /** - * Retrieve a policy definition in a management group. - * * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. @@ -945,17 +1038,14 @@ public Mono> getAtManagementGroupWithResponseAsy return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policyDefinitionName, apiVersion, accept, context)) + .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policyDefinitionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve a policy definition in a management group. - * * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. @@ -981,16 +1071,13 @@ private Mono> getAtManagementGroupWithResponseAs return Mono .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, policyDefinitionName, - apiVersion, accept, context); + return service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, + policyDefinitionName, accept, context); } /** - * Retrieve a policy definition in a management group. - * * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. @@ -1008,8 +1095,6 @@ public Mono getAtManagementGroupAsync(String managementGr } /** - * Retrieve a policy definition in a management group. - * * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. @@ -1027,8 +1112,6 @@ public Response getAtManagementGroupWithResponse(String m } /** - * Retrieve a policy definition in a management group. - * * This operation retrieves the policy definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. @@ -1044,447 +1127,249 @@ public PolicyDefinitionInner getAtManagementGroup(String managementGroupId, Stri } /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation creates or updates a policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top) { + public Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupId, String policyDefinitionName, PolicyDefinitionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - filter, top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, policyDefinitionName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation creates or updates a policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the policy definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top, - Context context) { + private Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupId, String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. - * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. - * - * @throws 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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); + return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policyDefinitionName, contentType, accept, parameters, context); } /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation creates or updates a policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedFlux}. + * @return the policy definition on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String policyDefinitionName, PolicyDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation creates or updates a policy definition in the given management group with the given name. * + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedIterable}. + * @return the policy definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, + String policyDefinitionName, PolicyDefinitionInner parameters, Context context) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, parameters, + context).block(); } /** - * Retrieves policy definitions in a subscription - * - * This operation retrieves a list of all the policy definitions in a given subscription that match the optional - * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq - * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the - * subscription, including those that apply directly or from management groups that contain the given subscription. - * If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * subscription. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy - * definitions whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and - * Static. If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions - * whose category match the {value}. + * This operation creates or updates a policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. + * @param parameters The policy definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedIterable}. + * @return the policy definition. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicyDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, String policyDefinitionName, + PolicyDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithResponse(managementGroupId, policyDefinitionName, parameters, + Context.NONE).getValue(); } /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync(String filter, Integer top) { + public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policyDefinitionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } return FluxUtil - .withContext( - context -> service.listBuiltIn(this.client.getEndpoint(), apiVersion, filter, top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, policyDefinitionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBuiltInSinglePageAsync(String filter, Integer top, - Context context) { + private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policyDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; + if (managementGroupId == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); + } + if (policyDefinitionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter policyDefinitionName is required and cannot be null.")); + } context = this.client.mergeContext(context); - return service.listBuiltIn(this.client.getEndpoint(), apiVersion, filter, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policyDefinitionName, context); } /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync(String filter, Integer top) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); - } - - /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. - * - * @throws 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 policy definitions as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteAtManagementGroupAsync(String managementGroupId, String policyDefinitionName) { + return deleteAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName) + .flatMap(ignored -> Mono.empty()); } /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBuiltInAsync(String filter, Integer top, Context context) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(filter, top, context), - nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. - * - * @throws 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 policy definitions as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listBuiltInAsync(filter, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAtManagementGroupWithResponse(String managementGroupId, String policyDefinitionName, + Context context) { + return deleteAtManagementGroupWithResponseAsync(managementGroupId, policyDefinitionName, context).block(); } /** - * Retrieve built-in policy definitions - * - * This operation retrieves a list of all the built-in policy definitions that match the optional given $filter. If - * $filter='policyType -eq {value}' is provided, the returned list only includes all built-in policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all built-in policy definitions whose - * category match the {value}. + * This operation deletes the policy definition in the given management group with the given name. * - * @param filter The filter to apply on the operation. Valid values for $filter are: 'atExactScope()', 'policyType - * -eq {value}' or 'category eq '{value}''. If $filter is not provided, no filtering is performed. If - * $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given - * scope. If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions - * whose type match the {value}. Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. If - * $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category - * match the {value}. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. + * @param managementGroupId The ID of the management group. + * @param policyDefinitionName The name of the policy definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(String filter, Integer top, Context context) { - return new PagedIterable<>(listBuiltInAsync(filter, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAtManagementGroup(String managementGroupId, String policyDefinitionName) { + deleteAtManagementGroupWithResponse(managementGroupId, policyDefinitionName, Context.NONE); } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1507,7 +1392,8 @@ public PagedIterable listBuiltIn(String filter, Integer t * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupSinglePageAsync(String managementGroupId, @@ -1520,19 +1406,16 @@ private Mono> listByManagementGroupSinglePa return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), apiVersion, - managementGroupId, filter, top, accept, context)) + .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, filter, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1556,7 +1439,8 @@ private Mono> listByManagementGroupSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupSinglePageAsync(String managementGroupId, @@ -1569,19 +1453,16 @@ private Mono> listByManagementGroupSinglePa return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByManagementGroup(this.client.getEndpoint(), apiVersion, managementGroupId, filter, top, accept, - context) + .listByManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, filter, + top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1604,7 +1485,7 @@ private Mono> listByManagementGroupSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, @@ -1614,8 +1495,6 @@ public PagedFlux listByManagementGroupAsync(String manage } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1630,7 +1509,7 @@ public PagedFlux listByManagementGroupAsync(String manage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByManagementGroupAsync(String managementGroupId) { @@ -1641,8 +1520,6 @@ public PagedFlux listByManagementGroupAsync(String manage } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1666,7 +1543,7 @@ public PagedFlux listByManagementGroupAsync(String manage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, @@ -1676,8 +1553,6 @@ private PagedFlux listByManagementGroupAsync(String manag } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1692,7 +1567,7 @@ private PagedFlux listByManagementGroupAsync(String manag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByManagementGroup(String managementGroupId) { @@ -1702,8 +1577,6 @@ public PagedIterable listByManagementGroup(String managem } /** - * Retrieve policy definitions in a management group - * * This operation retrieves a list of all the policy definitions in a given management group that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy definitions associated with the @@ -1727,7 +1600,7 @@ public PagedIterable listByManagementGroup(String managem * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicyDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByManagementGroup(String managementGroupId, String filter, @@ -1736,15 +1609,14 @@ public PagedIterable listByManagementGroup(String managem } /** - * Retrieves policy definitions in a subscription - * * 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1763,8 +1635,6 @@ private Mono> listNextSinglePageAsync(Strin } /** - * Retrieves policy definitions in a subscription - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1772,7 +1642,8 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1791,15 +1662,14 @@ private Mono> listNextSinglePageAsync(Strin } /** - * Retrieve built-in policy definitions - * * 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink) { @@ -1819,8 +1689,6 @@ private Mono> listBuiltInNextSinglePageAsyn } /** - * Retrieve built-in policy definitions - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1828,7 +1696,8 @@ private Mono> listBuiltInNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink, @@ -1848,15 +1717,14 @@ private Mono> listBuiltInNextSinglePageAsyn } /** - * Retrieve policy definitions in a management group - * * 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupNextSinglePageAsync(String nextLink) { @@ -1877,8 +1745,6 @@ private Mono> listByManagementGroupNextSing } /** - * Retrieve policy definitions in a management group - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1886,7 +1752,8 @@ private Mono> listByManagementGroupNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicyDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyExemptionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyExemptionsClientImpl.java index 2e11f424d331..9d5b28f55cd6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyExemptionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyExemptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionVersionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionVersionsClientImpl.java index 72663befee20..0e6e26791f11 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionVersionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionVersionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -65,140 +65,136 @@ public final class PolicySetDefinitionVersionsClientImpl * The interface defining all the services for PolicyClientPolicySetDefinitionVersions to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientPolicySetDefinitionVersions") public interface PolicySetDefinitionVersionsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllBuiltins(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllAtManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policySetDefinitionName") String policySetDefinitionName, @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicySetDefinitionVersionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicySetDefinitionVersionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policySetDefinitionName") String policySetDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuiltIn(@HostParam("$host") String endpoint, + Mono> getBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("policySetDefinitionName") String policySetDefinitionName, @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") + @Get("/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, + Mono> listBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltIn(@HostParam("$host") String endpoint, + Mono> getAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> createOrUpdateAtManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("managementGroupName") String managementGroupName, @PathParam("policySetDefinitionName") String policySetDefinitionName, @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicySetDefinitionVersionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicySetDefinitionVersionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupName") String managementGroupName, + Mono> deleteAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, @PathParam("policySetDefinitionName") String policySetDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("policyDefinitionVersion") String policyDefinitionVersion, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions/{policyDefinitionVersion}") + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup(@HostParam("$host") String endpoint, + Mono> listByManagementGroup( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @PathParam("policyDefinitionVersion") String policyDefinitionVersion, @QueryParam("$expand") String expand, + @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllBuiltins( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAllAtManagementGroup( + @HostParam("endpoint") String endpoint, @PathParam("managementGroupName") String managementGroupName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}/versions") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/listPolicySetDefinitionVersions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroup( - @HostParam("$host") String endpoint, @PathParam("managementGroupName") String managementGroupName, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + Mono> listAll(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -206,7 +202,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBuiltInNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -214,420 +210,244 @@ Mono> listBuiltInNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAllBuiltinsWithResponseAsync() { + public Mono> getWithResponseAsync(String policySetDefinitionName, + String policyDefinitionVersion, String expand) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllBuiltins(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, policyDefinitionVersion, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAllBuiltinsWithResponseAsync(Context context) { + private Mono> getWithResponseAsync(String policySetDefinitionName, + String policyDefinitionVersion, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listAllBuiltins(this.client.getEndpoint(), apiVersion, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policySetDefinitionName, policyDefinitionVersion, expand, accept, context); } /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions on successful completion of {@link Mono}. + * @return the policy set definition version on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllBuiltinsAsync() { - return listAllBuiltinsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAsync(String policySetDefinitionName, + String policyDefinitionVersion) { + final String expand = null; + return getWithResponseAsync(policySetDefinitionName, policyDefinitionVersion, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link Response}. + * @return the policy set definition version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAllBuiltinsWithResponse(Context context) { - return listAllBuiltinsWithResponseAsync(context).block(); + public Response getWithResponse(String policySetDefinitionName, + String policyDefinitionVersion, String expand, Context context) { + return getWithResponseAsync(policySetDefinitionName, policyDefinitionVersion, expand, context).block(); } /** - * Lists all built-in policy set definition versions. - * - * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * This operation retrieves the policy set definition version in the given subscription with the given name and + * version. * + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions. + * @return the policy set definition version. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionVersionListResultInner listAllBuiltins() { - return listAllBuiltinsWithResponse(Context.NONE).getValue(); + public PolicySetDefinitionVersionInner get(String policySetDefinitionName, String policyDefinitionVersion) { + final String expand = null; + return getWithResponse(policySetDefinitionName, policyDefinitionVersion, expand, Context.NONE).getValue(); } /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. + * This operation creates or updates a policy set definition version in the given subscription with the given name + * and version. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName) { + public Mono> createOrUpdateWithResponseAsync( + String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required 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 (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, - apiVersion, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, policyDefinitionVersion, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. + * This operation creates or updates a policy set definition version in the given subscription with the given name + * and version. * - * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAllAtManagementGroupWithResponseAsync(String managementGroupName, Context context) { + private Mono> createOrUpdateWithResponseAsync( + String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required 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 (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, apiVersion, accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, policyDefinitionVersion, contentType, accept, + parameters, context); } /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllAtManagementGroupAsync(String managementGroupName) { - return listAllAtManagementGroupWithResponseAsync(managementGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - listAllAtManagementGroupWithResponse(String managementGroupName, Context context) { - return listAllAtManagementGroupWithResponseAsync(managementGroupName, context).block(); - } - - /** - * Lists all policy set definition versions at management group scope. - * - * This operation lists all the policy set definition versions for all policy set definitions at the management - * group scope. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName) { - return listAllAtManagementGroupWithResponse(managementGroupName, Context.NONE).getValue(); - } - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listAllWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAll(this.client.getEndpoint(), this.client.getSubscriptionId(), - apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAll(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listAllAsync() { - return listAllWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAllWithResponse(Context context) { - return listAllWithResponseAsync(context).block(); - } - - /** - * Lists all policy set definition versions within a subscription. - * - * This operation lists all the policy set definition versions for all policy set definitions within a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionVersionListResultInner listAll() { - return listAllWithResponse(Context.NONE).getValue(); - } - - /** - * Creates or updates a policy set definition version. - * - * This operation creates or updates a policy set definition version in the given subscription with the given name - * and version. - * - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param parameters The policy set definition properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync( - String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a policy set definition version. - * - * This operation creates or updates a policy set definition version in the given subscription with the given name - * and version. - * - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param parameters The policy set definition properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String policySetDefinitionName, String policyDefinitionVersion, PolicySetDefinitionVersionInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context); - } - - /** - * Creates or updates a policy set definition version. - * - * This operation creates or updates a policy set definition version in the given subscription with the given name - * and version. + * This operation creates or updates a policy set definition version in the given subscription with the given name + * and version. * * @param policySetDefinitionName The name of the policy set definition. * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major @@ -646,8 +466,6 @@ public Mono createOrUpdateAsync(String policySe } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -669,8 +487,6 @@ public Response createOrUpdateWithResponse(Stri } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given subscription with the given name * and version. * @@ -691,8 +507,6 @@ public PolicySetDefinitionVersionInner createOrUpdate(String policySetDefinition } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -723,17 +537,13 @@ public Mono> deleteWithResponseAsync(String policySetDefinitionNa return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, policyDefinitionVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -765,16 +575,12 @@ private Mono> deleteWithResponseAsync(String policySetDefinitionN return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), policySetDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policySetDefinitionName, policyDefinitionVersion, context); } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -793,8 +599,6 @@ public Mono deleteAsync(String policySetDefinitionName, String policyDefin } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -814,8 +618,6 @@ public Response deleteWithResponse(String policySetDefinitionName, String } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given subscription with the given name and * version. * @@ -832,24 +634,21 @@ public void delete(String policySetDefinitionName, String policyDefinitionVersio } /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String policySetDefinitionName, - String policyDefinitionVersion, String expand) { + private Mono> listSinglePageAsync(String policySetDefinitionName, + String expand, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -862,38 +661,32 @@ public Mono> getWithResponseAsync(Stri return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, policyDefinitionVersion, expand, apiVersion, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String policySetDefinitionName, - String policyDefinitionVersion, String expand, Context context) { + private Mono> listSinglePageAsync(String policySetDefinitionName, + String expand, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -906,85 +699,109 @@ private Mono> getWithResponseAsync(Str return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), policySetDefinitionName, - policyDefinitionVersion, expand, apiVersion, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policySetDefinitionName, expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves a policy set definition version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String policySetDefinitionName, String expand, + Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String policySetDefinitionName, - String policyDefinitionVersion) { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String policySetDefinitionName) { final String expand = null; - return getWithResponseAsync(policySetDefinitionName, policyDefinitionVersion, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String policySetDefinitionName, - String policyDefinitionVersion, String expand, Context context) { - return getWithResponseAsync(policySetDefinitionName, policyDefinitionVersion, expand, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String policySetDefinitionName, String expand, + Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Retrieves a policy set definition version. - * - * This operation retrieves the policy set definition version in the given subscription with the given name and - * version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionVersionInner get(String policySetDefinitionName, String policyDefinitionVersion) { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String policySetDefinitionName) { final String expand = null; - return getWithResponse(policySetDefinitionName, policyDefinitionVersion, expand, Context.NONE).getValue(); + final Integer top = null; + return new PagedIterable<>(listAsync(policySetDefinitionName, expand, top)); } /** - * Retrieves a built in policy set definition version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition. * + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String policySetDefinitionName, String expand, + Integer top, Context context) { + return new PagedIterable<>(listAsync(policySetDefinitionName, expand, top, context)); + } + + /** * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -1012,17 +829,14 @@ public Mono> getBuiltInWithResponseAsy return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), policySetDefinitionName, - policyDefinitionVersion, expand, apiVersion, accept, context)) + .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policySetDefinitionName, policyDefinitionVersion, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -1051,16 +865,13 @@ private Mono> getBuiltInWithResponseAs return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getBuiltIn(this.client.getEndpoint(), policySetDefinitionName, policyDefinitionVersion, expand, - apiVersion, accept, context); + return service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policySetDefinitionName, + policyDefinitionVersion, expand, accept, context); } /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -1080,8 +891,6 @@ public Mono getBuiltInAsync(String policySetDef } /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -1102,8 +911,6 @@ public Response getBuiltInWithResponse(String p } /** - * Retrieves a built in policy set definition version. - * * This operation retrieves the built-in policy set definition version with the given name and version. * * @param policySetDefinitionName The name of the policy set definition. @@ -1122,9 +929,8 @@ public PolicySetDefinitionVersionInner getBuiltIn(String policySetDefinitionName } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -1133,38 +939,32 @@ public PolicySetDefinitionVersionInner getBuiltIn(String policySetDefinitionName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String policySetDefinitionName, - String expand, Integer top) { + private Mono> + listBuiltInSinglePageAsync(String policySetDefinitionName, String expand, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, apiVersion, expand, top, accept, context)) + .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policySetDefinitionName, expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -1174,38 +974,32 @@ private Mono> listSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String policySetDefinitionName, - String expand, Integer top, Context context) { + private Mono> + listBuiltInSinglePageAsync(String policySetDefinitionName, String expand, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), policySetDefinitionName, apiVersion, - expand, top, accept, context) + .listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policySetDefinitionName, expand, top, + accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -1214,38 +1008,36 @@ private Mono> listSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String policySetDefinitionName, String expand, + public PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String policySetDefinitionName) { + public PagedFlux listBuiltInAsync(String policySetDefinitionName) { final String expand = null; final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top), + nextLink -> listBuiltInNextSinglePageAsync(nextLink)); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -1255,37 +1047,36 @@ public PagedFlux listAsync(String policySetDefi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String policySetDefinitionName, String expand, + private PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(policySetDefinitionName, expand, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top, context), + nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String policySetDefinitionName) { + public PagedIterable listBuiltIn(String policySetDefinitionName) { final String expand = null; final Integer top = null; - return new PagedIterable<>(listAsync(policySetDefinitionName, expand, top)); + return new PagedIterable<>(listBuiltInAsync(policySetDefinitionName, expand, top)); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition. + * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy + * set definition. * * @param policySetDefinitionName The name of the policy set definition. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are @@ -1295,197 +1086,164 @@ public PagedIterable list(String policySetDefin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String policySetDefinitionName, String expand, + public PagedIterable listBuiltIn(String policySetDefinitionName, String expand, Integer top, Context context) { - return new PagedIterable<>(listAsync(policySetDefinitionName, expand, top, context)); + return new PagedIterable<>(listBuiltInAsync(policySetDefinitionName, expand, top, context)); } /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBuiltInSinglePageAsync(String policySetDefinitionName, String expand, Integer top) { + public Mono> getAtManagementGroupWithResponseAsync( + String managementGroupName, String policySetDefinitionName, String policyDefinitionVersion, String expand) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); + } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), policySetDefinitionName, apiVersion, - expand, top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policySetDefinitionName, policyDefinitionVersion, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBuiltInSinglePageAsync(String policySetDefinitionName, String expand, Integer top, Context context) { + private Mono> getAtManagementGroupWithResponseAsync( + String managementGroupName, String policySetDefinitionName, String policyDefinitionVersion, String expand, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); + } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (policyDefinitionVersion == null) { + return Mono.error( + new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBuiltIn(this.client.getEndpoint(), policySetDefinitionName, apiVersion, expand, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupName, + policySetDefinitionName, policyDefinitionVersion, expand, accept, context); } /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the policy set definition version on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, - Integer top) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAtManagementGroupAsync(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion) { + final String expand = null; + return getAtManagementGroupWithResponseAsync(managementGroupName, policySetDefinitionName, + policyDefinitionVersion, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the policy set definition version along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBuiltInAsync(String policySetDefinitionName) { - final String expand = null; - final Integer top = null; - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top), - nextLink -> listBuiltInNextSinglePageAsync(nextLink)); - } - - /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. - * - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBuiltInAsync(String policySetDefinitionName, String expand, - Integer top, Context context) { - return new PagedFlux<>(() -> listBuiltInSinglePageAsync(policySetDefinitionName, expand, top, context), - nextLink -> listBuiltInNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtManagementGroupWithResponse(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion, String expand, Context context) { + return getAtManagementGroupWithResponseAsync(managementGroupName, policySetDefinitionName, + policyDefinitionVersion, expand, context).block(); } /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. + * This operation retrieves the policy set definition version in the given management group with the given name and + * version. * + * @param managementGroupName The name of the management group. The name is case insensitive. * @param policySetDefinitionName The name of the policy set definition. + * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major + * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the policy set definition version. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(String policySetDefinitionName) { + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicySetDefinitionVersionInner getAtManagementGroup(String managementGroupName, + String policySetDefinitionName, String policyDefinitionVersion) { final String expand = null; - final Integer top = null; - return new PagedIterable<>(listBuiltInAsync(policySetDefinitionName, expand, top)); - } - - /** - * Retrieves built-in policy set definition versions. - * - * This operation retrieves a list of all the built-in policy set definition versions for the given built-in policy - * set definition. - * - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBuiltIn(String policySetDefinitionName, String expand, - Integer top, Context context) { - return new PagedIterable<>(listBuiltInAsync(policySetDefinitionName, expand, top, context)); + return getAtManagementGroupWithResponse(managementGroupName, policySetDefinitionName, policyDefinitionVersion, + expand, Context.NONE).getValue(); } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -1524,18 +1282,16 @@ public Mono> createOrUpdateAtManagemen } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policySetDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context)) + .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupName, policySetDefinitionName, policyDefinitionVersion, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -1575,16 +1331,15 @@ private Mono> createOrUpdateAtManageme } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policySetDefinitionName, policyDefinitionVersion, apiVersion, parameters, accept, context); + return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policySetDefinitionName, policyDefinitionVersion, contentType, accept, parameters, + context); } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -1606,8 +1361,6 @@ public Mono createOrUpdateAtManagementGroupAsyn } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -1631,8 +1384,6 @@ public Response createOrUpdateAtManagementGroup } /** - * Creates or updates a policy set definition version. - * * This operation creates or updates a policy set definition version in the given management group with the given * name and version. * @@ -1654,8 +1405,6 @@ public PolicySetDefinitionVersionInner createOrUpdateAtManagementGroup(String ma } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -1687,17 +1436,14 @@ public Mono> deleteAtManagementGroupWithResponseAsync(String mana return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policySetDefinitionName, policyDefinitionVersion, apiVersion, accept, context)) + .withContext( + context -> service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policySetDefinitionName, policyDefinitionVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -1730,16 +1476,12 @@ private Mono> deleteAtManagementGroupWithResponseAsync(String man return Mono.error( new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupName, policySetDefinitionName, - policyDefinitionVersion, apiVersion, accept, context); + return service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policySetDefinitionName, policyDefinitionVersion, context); } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -1760,8 +1502,6 @@ public Mono deleteAtManagementGroupAsync(String managementGroupName, Strin } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -1783,8 +1523,6 @@ public Response deleteAtManagementGroupWithResponse(String managementGroup } /** - * Deletes a policy set definition version. - * * This operation deletes the policy set definition version in the given management group with the given name and * version. * @@ -1804,25 +1542,300 @@ public void deleteAtManagementGroup(String managementGroupName, String policySet } /** - * Retrieves a policy set definition version. + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagementGroupSinglePageAsync( + String managementGroupName, String policySetDefinitionName, String expand, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupName, policySetDefinitionName, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagementGroupSinglePageAsync( + String managementGroupName, String policySetDefinitionName, String expand, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (managementGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupName, + policySetDefinitionName, expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByManagementGroupAsync(String managementGroupName, + String policySetDefinitionName, String expand, Integer top) { + return new PagedFlux<>( + () -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, expand, top), + nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByManagementGroupAsync(String managementGroupName, + String policySetDefinitionName) { + final String expand = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, expand, top), + nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagementGroupAsync(String managementGroupName, + String policySetDefinitionName, String expand, Integer top, Context context) { + return new PagedFlux<>(() -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, + expand, top, context), nextLink -> listByManagementGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagementGroup(String managementGroupName, + String policySetDefinitionName) { + final String expand = null; + final Integer top = null; + return new PagedIterable<>( + listByManagementGroupAsync(managementGroupName, policySetDefinitionName, expand, top)); + } + + /** + * This operation retrieves a list of all the policy set definition versions for the given policy set definition in + * a given management group. + * + * @param managementGroupName The name of the management group. The name is case insensitive. + * @param policySetDefinitionName The name of the policy set definition. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagementGroup(String managementGroupName, + String policySetDefinitionName, String expand, Integer top, Context context) { + return new PagedIterable<>( + listByManagementGroupAsync(managementGroupName, policySetDefinitionName, expand, top, context)); + } + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listAllBuiltinsWithResponseAsync() { + 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.listAllBuiltins(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAllBuiltinsWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listAllBuiltins(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + } + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAllBuiltinsAsync() { + return listAllBuiltinsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAllBuiltinsWithResponse(Context context) { + return listAllBuiltinsWithResponseAsync(context).block(); + } + + /** + * Lists all built-in policy set definition versions. + * + * This operation lists all the built-in policy set definition versions for all built-in policy set definitions. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinitionVersion list operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicySetDefinitionVersionListResultInner listAllBuiltins() { + return listAllBuiltinsWithResponse(Context.NONE).getValue(); + } + + /** + * Lists all policy set definition versions at management group scope. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupWithResponseAsync( - String managementGroupName, String policySetDefinitionName, String policyDefinitionVersion, String expand) { + public Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1831,44 +1844,30 @@ public Mono> getAtManagementGroupWithR return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), managementGroupName, - policySetDefinitionName, policyDefinitionVersion, expand, apiVersion, accept, context)) + .withContext(context -> service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy set definition version. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupWithResponseAsync( - String managementGroupName, String policySetDefinitionName, String policyDefinitionVersion, String expand, - Context context) { + private Mono> + listAllAtManagementGroupWithResponseAsync(String managementGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1877,305 +1876,174 @@ private Mono> getAtManagementGroupWith return Mono .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - if (policyDefinitionVersion == null) { - return Mono.error( - new IllegalArgumentException("Parameter policyDefinitionVersion is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroup(this.client.getEndpoint(), managementGroupName, policySetDefinitionName, - policyDefinitionVersion, expand, apiVersion, accept, context); + return service.listAllAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), accept, context); } /** - * Retrieves a policy set definition version. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupAsync(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion) { - final String expand = null; - return getAtManagementGroupWithResponseAsync(managementGroupName, policySetDefinitionName, - policyDefinitionVersion, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono listAllAtManagementGroupAsync(String managementGroupName) { + return listAllAtManagementGroupWithResponseAsync(managementGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves a policy set definition version. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version along with {@link Response}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupWithResponse(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion, String expand, Context context) { - return getAtManagementGroupWithResponseAsync(managementGroupName, policySetDefinitionName, - policyDefinitionVersion, expand, context).block(); + public Response + listAllAtManagementGroupWithResponse(String managementGroupName, Context context) { + return listAllAtManagementGroupWithResponseAsync(managementGroupName, context).block(); } /** - * Retrieves a policy set definition version. + * Lists all policy set definition versions at management group scope. * - * This operation retrieves the policy set definition version in the given management group with the given name and - * version. + * This operation lists all the policy set definition versions for all policy set definitions at the management + * group scope. * * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param policyDefinitionVersion The policy set definition version. The format is x.y.z where x is the major - * version number, y is the minor version number, and z is the patch number. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition version. + * @return the response of a PolicySetDefinitionVersion list operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionVersionInner getAtManagementGroup(String managementGroupName, - String policySetDefinitionName, String policyDefinitionVersion) { - final String expand = null; - return getAtManagementGroupWithResponse(managementGroupName, policySetDefinitionName, policyDefinitionVersion, - expand, Context.NONE).getValue(); + public PolicySetDefinitionVersionListResultInner listAllAtManagementGroup(String managementGroupName) { + return listAllAtManagementGroupWithResponse(managementGroupName, Context.NONE).getValue(); } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions within a subscription. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupSinglePageAsync( - String managementGroupName, String policySetDefinitionName, String expand, Integer top) { + public Mono> listAllWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), managementGroupName, - policySetDefinitionName, apiVersion, expand, top, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.listAll(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions within a subscription. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByManagementGroupSinglePageAsync( - String managementGroupName, String policySetDefinitionName, String expand, Integer top, Context context) { + private Mono> listAllWithResponseAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (managementGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter managementGroupName is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByManagementGroup(this.client.getEndpoint(), managementGroupName, policySetDefinitionName, apiVersion, - expand, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByManagementGroupAsync(String managementGroupName, - String policySetDefinitionName, String expand, Integer top) { - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, expand, top), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + return service.listAll(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context); } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions within a subscription. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinitionVersion list operation on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByManagementGroupAsync(String managementGroupName, - String policySetDefinitionName) { - final String expand = null; - final Integer top = null; - return new PagedFlux<>( - () -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, expand, top), - nextLink -> listByManagementGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listAllAsync() { + return listAllWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions within a subscription. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByManagementGroupAsync(String managementGroupName, - String policySetDefinitionName, String expand, Integer top, Context context) { - return new PagedFlux<>(() -> listByManagementGroupSinglePageAsync(managementGroupName, policySetDefinitionName, - expand, top, context), nextLink -> listByManagementGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. - * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. - * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupName, - String policySetDefinitionName) { - final String expand = null; - final Integer top = null; - return new PagedIterable<>( - listByManagementGroupAsync(managementGroupName, policySetDefinitionName, expand, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAllWithResponse(Context context) { + return listAllWithResponseAsync(context).block(); } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. + * Lists all policy set definition versions within a subscription. * - * This operation retrieves a list of all the policy set definition versions for the given policy set definition in - * a given management group. + * This operation lists all the policy set definition versions for all policy set definitions within a subscription. * - * @param managementGroupName The name of the management group. The name is case insensitive. - * @param policySetDefinitionName The name of the policy set definition. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinitionVersion list operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByManagementGroup(String managementGroupName, - String policySetDefinitionName, String expand, Integer top, Context context) { - return new PagedIterable<>( - listByManagementGroupAsync(managementGroupName, policySetDefinitionName, expand, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicySetDefinitionVersionListResultInner listAll() { + return listAllWithResponse(Context.NONE).getValue(); } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * * 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -2194,8 +2062,6 @@ private Mono> listNextSinglePageA } /** - * Retrieves the policy set definition versions for a given policy set definition in a subscription. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2203,8 +2069,8 @@ private Mono> listNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, @@ -2224,16 +2090,14 @@ private Mono> listNextSinglePageA } /** - * Retrieves built-in policy set definition versions. - * * 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink) { @@ -2253,8 +2117,6 @@ private Mono> listBuiltInNextSing } /** - * Retrieves built-in policy set definition versions. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2262,8 +2124,8 @@ private Mono> listBuiltInNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink, @@ -2283,16 +2145,14 @@ private Mono> listBuiltInNextSing } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. - * * 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -2314,8 +2174,6 @@ private Mono> listBuiltInNextSing } /** - * Retrieves all policy set definition versions for a given policy set definition in a management group. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -2323,8 +2181,8 @@ private Mono> listBuiltInNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definition versions along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the response of a PolicySetDefinitionVersion list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java index b747d635631b..48ace0fb5ce3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.PolicySetDefinitionsClient; import com.azure.resourcemanager.resources.fluent.models.PolicySetDefinitionInner; -import com.azure.resourcemanager.resources.models.PolicySetDefinitionListResult; +import com.azure.resourcemanager.resources.implementation.models.PolicySetDefinitionListResult; import reactor.core.publisher.Mono; /** @@ -62,108 +62,103 @@ public final class PolicySetDefinitionsClientImpl implements PolicySetDefinition * The interface defining all the services for PolicyClientPolicySetDefinitions to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientPolicySetDefinitions") public interface PolicySetDefinitionsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicySetDefinitionInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicySetDefinitionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuiltIn(@HostParam("$host") String endpoint, + Mono> getBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Authorization/policySetDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBuiltIn(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam(value = "$filter", encoded = true) String filter, + Mono> listBuiltIn(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, + Mono> createOrUpdateAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PolicySetDefinitionInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicySetDefinitionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("policySetDefinitionName") String policySetDefinitionName, @QueryParam("$expand") String expand, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> deleteAtManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @PathParam("policySetDefinitionName") String policySetDefinitionName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policySetDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByManagementGroup(@HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, @QueryParam("api-version") String apiVersion, - @QueryParam(value = "$filter", encoded = true) String filter, @QueryParam("$expand") String expand, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + Mono> listByManagementGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + @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, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -171,7 +166,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBuiltInNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -179,25 +174,24 @@ Mono> listBuiltInNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByManagementGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, - PolicySetDefinitionInner parameters) { + public Mono> getWithResponseAsync(String policySetDefinitionName, + String expand) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -210,26 +204,19 @@ public Mono> createOrUpdateWithResponseAsync( return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, apiVersion, parameters, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -237,8 +224,8 @@ public Mono> createOrUpdateWithResponseAsync( * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, - PolicySetDefinitionInner parameters, Context context) { + private Mono> getWithResponseAsync(String policySetDefinitionName, String expand, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -251,44 +238,33 @@ private Mono> createOrUpdateWithResponseAsync return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, apiVersion, parameters, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policySetDefinitionName, expand, accept, context); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String policySetDefinitionName, - PolicySetDefinitionInner parameters) { - return createOrUpdateWithResponseAsync(policySetDefinitionName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAsync(String policySetDefinitionName) { + final String expand = null; + return getWithResponseAsync(policySetDefinitionName, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -296,159 +272,39 @@ public Mono createOrUpdateAsync(String policySetDefini * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String policySetDefinitionName, - PolicySetDefinitionInner parameters, Context context) { - return createOrUpdateWithResponseAsync(policySetDefinitionName, parameters, context).block(); + public Response getWithResponse(String policySetDefinitionName, String expand, + Context context) { + return getWithResponseAsync(policySetDefinitionName, expand, context).block(); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given subscription with the given name. + * This operation retrieves the policy set definition in the given subscription with the given name. * - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, - PolicySetDefinitionInner parameters) { - return createOrUpdateWithResponse(policySetDefinitionName, parameters, Context.NONE).getValue(); - } - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String policySetDefinitionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String policySetDefinitionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (policySetDefinitionName == null) { - return Mono.error( - new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); - } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), policySetDefinitionName, - apiVersion, accept, context); - } - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String policySetDefinitionName) { - return deleteWithResponseAsync(policySetDefinitionName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String policySetDefinitionName, Context context) { - return deleteWithResponseAsync(policySetDefinitionName, context).block(); - } - - /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given subscription with the given name. - * - * @param policySetDefinitionName The name of the policy set definition to delete. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String policySetDefinitionName) { - deleteWithResponse(policySetDefinitionName, Context.NONE); + public PolicySetDefinitionInner get(String policySetDefinitionName) { + final String expand = null; + return getWithResponse(policySetDefinitionName, expand, Context.NONE).getValue(); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String policySetDefinitionName, - String expand) { + public Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, + PolicySetDefinitionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -461,22 +317,24 @@ public Mono> getWithResponseAsync(String poli return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - policySetDefinitionName, expand, apiVersion, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -484,8 +342,8 @@ public Mono> getWithResponseAsync(String poli * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String policySetDefinitionName, String expand, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String policySetDefinitionName, + PolicySetDefinitionInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -498,38 +356,40 @@ private Mono> getWithResponseAsync(String pol return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), policySetDefinitionName, expand, - apiVersion, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, contentType, accept, parameters, context); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String policySetDefinitionName) { - final String expand = null; - return getWithResponseAsync(policySetDefinitionName, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono createOrUpdateAsync(String policySetDefinitionName, + PolicySetDefinitionInner parameters) { + return createOrUpdateWithResponseAsync(policySetDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -537,150 +397,128 @@ public Mono getAsync(String policySetDefinitionName) { * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String policySetDefinitionName, String expand, - Context context) { - return getWithResponseAsync(policySetDefinitionName, expand, context).block(); + public Response createOrUpdateWithResponse(String policySetDefinitionName, + PolicySetDefinitionInner parameters, Context context) { + return createOrUpdateWithResponseAsync(policySetDefinitionName, parameters, context).block(); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given subscription with the given name. + * This operation creates or updates a policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionInner get(String policySetDefinitionName) { - final String expand = null; - return getWithResponse(policySetDefinitionName, expand, Context.NONE).getValue(); + public PolicySetDefinitionInner createOrUpdate(String policySetDefinitionName, + PolicySetDefinitionInner parameters) { + return createOrUpdateWithResponse(policySetDefinitionName, parameters, Context.NONE).getValue(); } /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, - String expand) { + public Mono> deleteWithResponseAsync(String policySetDefinitionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), policySetDefinitionName, expand, - apiVersion, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), policySetDefinitionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, - String expand, Context context) { + private Mono> deleteWithResponseAsync(String policySetDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (policySetDefinitionName == null) { return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getBuiltIn(this.client.getEndpoint(), policySetDefinitionName, expand, apiVersion, accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + policySetDefinitionName, context); } /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuiltInAsync(String policySetDefinitionName) { - final String expand = null; - return getBuiltInWithResponseAsync(policySetDefinitionName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String policySetDefinitionName) { + return deleteWithResponseAsync(policySetDefinitionName).flatMap(ignored -> Mono.empty()); } /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuiltInWithResponse(String policySetDefinitionName, String expand, - Context context) { - return getBuiltInWithResponseAsync(policySetDefinitionName, expand, context).block(); + public Response deleteWithResponse(String policySetDefinitionName, Context context) { + return deleteWithResponseAsync(policySetDefinitionName, context).block(); } /** - * Retrieves a built in policy set definition. - * - * This operation retrieves the built-in policy set definition with the given name. + * This operation deletes the policy set definition in the given subscription with the given name. * * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionInner getBuiltIn(String policySetDefinitionName) { - final String expand = null; - return getBuiltInWithResponse(policySetDefinitionName, expand, Context.NONE).getValue(); + public void delete(String policySetDefinitionName) { + deleteWithResponse(policySetDefinitionName, Context.NONE); } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -704,7 +542,8 @@ public PolicySetDefinitionInner getBuiltIn(String policySetDefinitionName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, String expand, @@ -717,19 +556,16 @@ private Mono> listSinglePageAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, - filter, expand, top, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -754,7 +590,8 @@ private Mono> listSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, String expand, Integer top, @@ -767,19 +604,16 @@ private Mono> listSinglePageAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, filter, expand, top, accept, - context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + expand, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -803,7 +637,7 @@ private Mono> listSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String filter, String expand, Integer top) { @@ -812,8 +646,6 @@ public PagedFlux listAsync(String filter, String expan } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -826,7 +658,7 @@ public PagedFlux listAsync(String filter, String expan * * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { @@ -838,8 +670,6 @@ public PagedFlux listAsync() { } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -864,7 +694,7 @@ public PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, String expand, Integer top, Context context) { @@ -873,8 +703,6 @@ private PagedFlux listAsync(String filter, String expa } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -887,7 +715,7 @@ private PagedFlux listAsync(String filter, String expa * * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -898,8 +726,6 @@ public PagedIterable list() { } /** - * Retrieves the policy set definitions for a subscription. - * * This operation retrieves a list of all the policy set definitions in a given subscription that match the optional * given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -919,21 +745,126 @@ public PagedIterable list() { * whose category match the {value}. * @param expand Comma-separated list of additional properties to be included in the response. Supported values are * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. - * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param top Maximum number of records to return. When the $top filter is not provided, it will return 500 records. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String expand, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, expand, top, context)); + } + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, + String expand) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), + policySetDefinitionName, expand, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuiltInWithResponseAsync(String policySetDefinitionName, + String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (policySetDefinitionName == null) { + return Mono.error( + new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), policySetDefinitionName, + expand, accept, context); + } + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBuiltInAsync(String policySetDefinitionName) { + final String expand = null; + return getBuiltInWithResponseAsync(policySetDefinitionName, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * This operation retrieves the built-in policy set definition with the given name. + * + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the policy set definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String expand, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, expand, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuiltInWithResponse(String policySetDefinitionName, String expand, + Context context) { + return getBuiltInWithResponseAsync(policySetDefinitionName, expand, context).block(); } /** - * Retrieves built-in policy set definitions. + * This operation retrieves the built-in policy set definition with the given name. * + * @param policySetDefinitionName The name of the policy set definition to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PolicySetDefinitionInner getBuiltIn(String policySetDefinitionName) { + final String expand = null; + return getBuiltInWithResponse(policySetDefinitionName, expand, Context.NONE).getValue(); + } + + /** * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -951,7 +882,8 @@ public PagedIterable list(String filter, String expand * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInSinglePageAsync(String filter, String expand, @@ -960,18 +892,16 @@ private Mono> listBuiltInSinglePageAsync return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listBuiltIn(this.client.getEndpoint(), apiVersion, filter, expand, top, accept, context)) + return FluxUtil + .withContext(context -> service.listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), filter, + expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -990,7 +920,8 @@ private Mono> listBuiltInSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInSinglePageAsync(String filter, String expand, @@ -999,17 +930,15 @@ private Mono> listBuiltInSinglePageAsync return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listBuiltIn(this.client.getEndpoint(), apiVersion, filter, expand, top, accept, context) + return service + .listBuiltIn(this.client.getEndpoint(), this.client.getApiVersion(), filter, expand, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -1027,7 +956,7 @@ private Mono> listBuiltInSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listBuiltInAsync(String filter, String expand, Integer top) { @@ -1036,15 +965,13 @@ public PagedFlux listBuiltInAsync(String filter, Strin } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. * * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listBuiltInAsync() { @@ -1056,8 +983,6 @@ public PagedFlux listBuiltInAsync() { } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -1076,7 +1001,7 @@ public PagedFlux listBuiltInAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBuiltInAsync(String filter, String expand, Integer top, @@ -1086,15 +1011,13 @@ private PagedFlux listBuiltInAsync(String filter, Stri } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. * * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBuiltIn() { @@ -1105,8 +1028,6 @@ public PagedIterable listBuiltIn() { } /** - * Retrieves built-in policy set definitions. - * * This operation retrieves a list of all the built-in policy set definitions that match the optional given $filter. * If $filter='category -eq {value}' is provided, the returned list only includes all built-in policy set * definitions whose category match the {value}. @@ -1125,7 +1046,7 @@ public PagedIterable listBuiltIn() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBuiltIn(String filter, String expand, Integer top, @@ -1134,21 +1055,20 @@ public PagedIterable listBuiltIn(String filter, String } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupId, String policySetDefinitionName, PolicySetDefinitionInner parameters) { + public Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName, String expand) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1161,27 +1081,20 @@ public Mono> createOrUpdateAtManagementGroupW return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), - managementGroupId, policySetDefinitionName, apiVersion, parameters, accept, context)) + .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policySetDefinitionName, expand, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1189,9 +1102,8 @@ public Mono> createOrUpdateAtManagementGroupW * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAtManagementGroupWithResponseAsync( - String managementGroupId, String policySetDefinitionName, PolicySetDefinitionInner parameters, - Context context) { + private Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName, String expand, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1204,46 +1116,37 @@ private Mono> createOrUpdateAtManagementGroup return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policySetDefinitionName, apiVersion, parameters, accept, context); + return service.getAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, + policySetDefinitionName, expand, accept, context); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, parameters) + public Mono getAtManagementGroupAsync(String managementGroupId, + String policySetDefinitionName) { + final String expand = null; + return getAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, expand) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param expand Comma-separated list of additional properties to be included in the response. Supported values are + * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1251,47 +1154,43 @@ public Mono createOrUpdateAtManagementGroupAsync(Strin * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters, Context context) { - return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, parameters, - context).block(); + public Response getAtManagementGroupWithResponse(String managementGroupId, + String policySetDefinitionName, String expand, Context context) { + return getAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, expand, context) + .block(); } /** - * Creates or updates a policy set definition. - * - * This operation creates or updates a policy set definition in the given management group with the given name. + * This operation retrieves the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to create. - * @param parameters The policy set definition properties. + * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, - String policySetDefinitionName, PolicySetDefinitionInner parameters) { - return createOrUpdateAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, parameters, - Context.NONE).getValue(); + public PolicySetDefinitionInner getAtManagementGroup(String managementGroupId, String policySetDefinitionName) { + final String expand = null; + return getAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, expand, Context.NONE) + .getValue(); } /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName) { + public Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupId, String policySetDefinitionName, PolicySetDefinitionInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1304,30 +1203,36 @@ public Mono> deleteAtManagementGroupWithResponseAsync(String mana return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policySetDefinitionName, apiVersion, accept, context)) + .withContext(context -> service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, policySetDefinitionName, contentType, accept, + parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName, Context context) { + private Mono> createOrUpdateAtManagementGroupWithResponseAsync( + String managementGroupId, String policySetDefinitionName, PolicySetDefinitionInner parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1340,83 +1245,86 @@ private Mono> deleteAtManagementGroupWithResponseAsync(String man return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtManagementGroup(this.client.getEndpoint(), managementGroupId, policySetDefinitionName, - apiVersion, accept, context); + return service.createOrUpdateAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policySetDefinitionName, contentType, accept, parameters, context); } /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the policy set definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName) { - return deleteAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName) - .flatMap(ignored -> Mono.empty()); + public Mono createOrUpdateAtManagementGroupAsync(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the policy set definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAtManagementGroupWithResponse(String managementGroupId, String policySetDefinitionName, - Context context) { - return deleteAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, context).block(); + public Response createOrUpdateAtManagementGroupWithResponse(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters, Context context) { + return createOrUpdateAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, parameters, + context).block(); } /** - * Deletes a policy set definition. - * - * This operation deletes the policy set definition in the given management group with the given name. + * This operation creates or updates a policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. - * @param policySetDefinitionName The name of the policy set definition to delete. + * @param policySetDefinitionName The name of the policy set definition to get. + * @param parameters The policy set definition properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtManagementGroup(String managementGroupId, String policySetDefinitionName) { - deleteAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, Context.NONE); + public PolicySetDefinitionInner createOrUpdateAtManagementGroup(String managementGroupId, + String policySetDefinitionName, PolicySetDefinitionInner parameters) { + return createOrUpdateAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, parameters, + Context.NONE).getValue(); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName, String expand) { + public Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1429,32 +1337,26 @@ public Mono> getAtManagementGroupWithResponse return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, - policySetDefinitionName, expand, apiVersion, accept, context)) + .withContext(context -> service.deleteAtManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, policySetDefinitionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtManagementGroupWithResponseAsync(String managementGroupId, - String policySetDefinitionName, String expand, Context context) { + private Mono> deleteAtManagementGroupWithResponseAsync(String managementGroupId, + String policySetDefinitionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1467,77 +1369,59 @@ private Mono> getAtManagementGroupWithRespons return Mono.error( new IllegalArgumentException("Parameter policySetDefinitionName is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtManagementGroup(this.client.getEndpoint(), managementGroupId, policySetDefinitionName, - expand, apiVersion, accept, context); + return service.deleteAtManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), + managementGroupId, policySetDefinitionName, context); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtManagementGroupAsync(String managementGroupId, - String policySetDefinitionName) { - final String expand = null; - return getAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAtManagementGroupAsync(String managementGroupId, String policySetDefinitionName) { + return deleteAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName) + .flatMap(ignored -> Mono.empty()); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. - * @param expand Comma-separated list of additional properties to be included in the response. Supported values are - * 'LatestDefinitionVersion, EffectiveDefinitionVersion'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtManagementGroupWithResponse(String managementGroupId, - String policySetDefinitionName, String expand, Context context) { - return getAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, expand, context) - .block(); + public Response deleteAtManagementGroupWithResponse(String managementGroupId, String policySetDefinitionName, + Context context) { + return deleteAtManagementGroupWithResponseAsync(managementGroupId, policySetDefinitionName, context).block(); } /** - * Retrieves a policy set definition. - * - * This operation retrieves the policy set definition in the given management group with the given name. + * This operation deletes the policy set definition in the given management group with the given name. * * @param managementGroupId The ID of the management group. * @param policySetDefinitionName The name of the policy set definition to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the policy set definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PolicySetDefinitionInner getAtManagementGroup(String managementGroupId, String policySetDefinitionName) { - final String expand = null; - return getAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, expand, Context.NONE) - .getValue(); + public void deleteAtManagementGroup(String managementGroupId, String policySetDefinitionName) { + deleteAtManagementGroupWithResponse(managementGroupId, policySetDefinitionName, Context.NONE); } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1562,7 +1446,8 @@ public PolicySetDefinitionInner getAtManagementGroup(String managementGroupId, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupSinglePageAsync(String managementGroupId, @@ -1575,19 +1460,16 @@ private Mono> listByManagementGroupSingl return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), managementGroupId, - apiVersion, filter, expand, top, accept, context)) + .withContext(context -> service.listByManagementGroup(this.client.getEndpoint(), + this.client.getApiVersion(), managementGroupId, filter, expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1613,7 +1495,8 @@ private Mono> listByManagementGroupSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupSinglePageAsync(String managementGroupId, @@ -1626,19 +1509,16 @@ private Mono> listByManagementGroupSingl return Mono .error(new IllegalArgumentException("Parameter managementGroupId is required and cannot be null.")); } - final String apiVersion = "2025-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByManagementGroup(this.client.getEndpoint(), managementGroupId, apiVersion, filter, expand, top, - accept, context) + .listByManagementGroup(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, filter, + expand, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1663,7 +1543,7 @@ private Mono> listByManagementGroupSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, @@ -1673,8 +1553,6 @@ public PagedFlux listByManagementGroupAsync(String man } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1689,7 +1567,7 @@ public PagedFlux listByManagementGroupAsync(String man * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByManagementGroupAsync(String managementGroupId) { @@ -1701,8 +1579,6 @@ public PagedFlux listByManagementGroupAsync(String man } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1728,7 +1604,7 @@ public PagedFlux listByManagementGroupAsync(String man * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedFlux}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByManagementGroupAsync(String managementGroupId, String filter, @@ -1739,8 +1615,6 @@ private PagedFlux listByManagementGroupAsync(String ma } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1755,7 +1629,7 @@ private PagedFlux listByManagementGroupAsync(String ma * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByManagementGroup(String managementGroupId) { @@ -1766,8 +1640,6 @@ public PagedIterable listByManagementGroup(String mana } /** - * Retrieves all policy set definitions in management group. - * * This operation retrieves a list of all the policy set definitions in a given management group that match the * optional given $filter. Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq * '{value}''. If $filter is not provided, the unfiltered list includes all policy set definitions associated with @@ -1793,7 +1665,7 @@ public PagedIterable listByManagementGroup(String mana * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions as paginated response with {@link PagedIterable}. + * @return the response of a PolicySetDefinition list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByManagementGroup(String managementGroupId, String filter, @@ -1802,15 +1674,14 @@ public PagedIterable listByManagementGroup(String mana } /** - * Retrieves the policy set definitions for a subscription. - * * 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1829,8 +1700,6 @@ private Mono> listNextSinglePageAsync(St } /** - * Retrieves the policy set definitions for a subscription. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1838,7 +1707,8 @@ private Mono> listNextSinglePageAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -1857,15 +1727,14 @@ private Mono> listNextSinglePageAsync(St } /** - * Retrieves built-in policy set definitions. - * * 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink) { @@ -1885,8 +1754,6 @@ private Mono> listBuiltInNextSinglePageA } /** - * Retrieves built-in policy set definitions. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1894,7 +1761,8 @@ private Mono> listBuiltInNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBuiltInNextSinglePageAsync(String nextLink, @@ -1914,15 +1782,14 @@ private Mono> listBuiltInNextSinglePageA } /** - * Retrieves all policy set definitions in management group. - * * 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupNextSinglePageAsync(String nextLink) { @@ -1943,8 +1810,6 @@ private Mono> listByManagementGroupNextS } /** - * Retrieves all policy set definitions in management group. - * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -1952,7 +1817,8 @@ private Mono> listByManagementGroupNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 policy set definitions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a PolicySetDefinition list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByManagementGroupNextSinglePageAsync(String nextLink, diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyTokensClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyTokensClientImpl.java index 5428b994d96f..100b3d72eeeb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyTokensClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/PolicyTokensClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -56,26 +55,24 @@ public final class PolicyTokensClientImpl implements PolicyTokensClient { * The interface defining all the services for PolicyClientPolicyTokens to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "PolicyClientPolicyTokens") public interface PolicyTokensService { - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/acquirePolicyToken") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> acquire(@HostParam("$host") String endpoint, + Mono> acquire(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PolicyTokenRequest parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyTokenRequest parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Authorization/acquirePolicyToken") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> acquireAtManagementGroup(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupName") String managementGroupName, - @BodyParam("application/json") PolicyTokenRequest parameters, @HeaderParam("Accept") String accept, - Context context); + Mono> acquireAtManagementGroup(@HostParam("endpoint") String endpoint, + @PathParam("managementGroupName") String managementGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyTokenRequest parameters, Context context); } /** @@ -83,7 +80,7 @@ Mono> acquireAtManagementGroup(@HostParam("$h * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -105,11 +102,11 @@ public Mono> acquireWithResponseAsync(PolicyT } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.acquire(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.acquire(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -118,7 +115,7 @@ public Mono> acquireWithResponseAsync(PolicyT * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -142,11 +139,11 @@ private Mono> acquireWithResponseAsync(Policy } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.acquire(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), parameters, - accept, context); + return service.acquire(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + contentType, accept, parameters, context); } /** @@ -154,7 +151,7 @@ private Mono> acquireWithResponseAsync(Policy * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -170,7 +167,7 @@ public Mono acquireAsync(PolicyTokenRequest parameters * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -187,7 +184,7 @@ public Response acquireWithResponse(PolicyTokenRequest * * This operation acquires a policy token in the given subscription for the given request body. * - * @param parameters The policy token properties. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -203,7 +200,7 @@ public PolicyTokenResponseInner acquire(PolicyTokenRequest parameters) { * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -227,11 +224,11 @@ public PolicyTokenResponseInner acquire(PolicyTokenRequest parameters) { } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.acquireAtManagementGroup(this.client.getEndpoint(), apiVersion, - managementGroupName, parameters, accept, context)) + .withContext(context -> service.acquireAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -240,7 +237,7 @@ public PolicyTokenResponseInner acquire(PolicyTokenRequest parameters) { * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -265,11 +262,11 @@ private Mono> acquireAtManagementGroupWithRes } else { parameters.validate(); } - final String apiVersion = "2025-03-01"; + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.acquireAtManagementGroup(this.client.getEndpoint(), apiVersion, managementGroupName, parameters, - accept, context); + return service.acquireAtManagementGroup(this.client.getEndpoint(), managementGroupName, + this.client.getApiVersion(), contentType, accept, parameters, context); } /** @@ -277,7 +274,7 @@ private Mono> acquireAtManagementGroupWithRes * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -296,7 +293,7 @@ public Mono acquireAtManagementGroupAsync(String manag * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -315,7 +312,7 @@ public Response acquireAtManagementGroupWithResponse(S * * This operation acquires a policy token in the given management group for the given request body. * - * @param managementGroupName The name of the management group. + * @param managementGroupName The name of the management group. The name is case insensitive. * @param parameters The policy token properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderResourceTypesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderResourceTypesClientImpl.java index c6b41054200f..801742afcb44 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderResourceTypesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProviderResourceTypesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -54,17 +54,17 @@ public final class ProviderResourceTypesClientImpl implements ProviderResourceTy * The interface defining all the services for ResourceManagementClientProviderResourceTypes to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ResourceManagementClientProviderResourceTypes") public interface ProviderResourceTypesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("$expand") String expand, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); } @@ -72,8 +72,7 @@ Mono> list(@HostParam("$host") Str * List the resource types for a specified resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. + * @param expand The $expand query parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -87,18 +86,18 @@ public Mono> listWithResponseAsync return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), expand, resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), expand, resourceProviderNamespace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -106,8 +105,7 @@ public Mono> listWithResponseAsync * List the resource types for a specified resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. + * @param expand The $expand query parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -122,18 +120,18 @@ private Mono> listWithResponseAsyn return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), expand, resourceProviderNamespace, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + expand, resourceProviderNamespace, accept, context); } /** @@ -156,8 +154,7 @@ public Mono listAsync(String resourceProvid * List the resource types for a specified resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @param expand The $expand query parameter. For example, to include property aliases in response, use - * $expand=resourceTypes/aliases. + * @param expand The $expand query parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java index f17baa27e7de..3159e9fbed65 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -30,7 +30,7 @@ import com.azure.resourcemanager.resources.fluent.ProvidersClient; import com.azure.resourcemanager.resources.fluent.models.ProviderInner; import com.azure.resourcemanager.resources.fluent.models.ProviderPermissionListResultInner; -import com.azure.resourcemanager.resources.models.ProviderListResult; +import com.azure.resourcemanager.resources.implementation.models.ProviderListResult; import com.azure.resourcemanager.resources.models.ProviderRegistrationRequest; import reactor.core.publisher.Mono; @@ -63,94 +63,217 @@ public final class ProvidersClientImpl implements ProvidersClient { * The interface defining all the services for ResourceManagementClientProviders to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ResourceManagementClientProviders") public interface ProvidersService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unregister(@HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + Mono> unregister(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> registerAtManagementGroupScope(@HostParam("$host") String endpoint, + Mono> registerAtManagementGroupScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, @PathParam("groupId") String groupId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("groupId") String groupId, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> providerPermissions(@HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + Mono> providerPermissions(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> register(@HostParam("$host") String endpoint, - @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + Mono> register(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ProviderRegistrationRequest properties, @HeaderParam("Accept") String accept, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProviderRegistrationRequest properties, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScope(@HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @QueryParam("$expand") String expand, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/{resourceProviderNamespace}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtTenantScope(@HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, + Mono> getAtTenantScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$expand") String expand, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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); + Mono> listAtTenantScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAtTenantScopeNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync(String expand) { + 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.listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + expand, 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 resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync(String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), expand, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtTenantScopeAsync(String expand) { + return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for the tenant. + * + * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAtTenantScopeAsync() { + final String expand = null; + return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String expand, Context context) { + return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand, context), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all resource providers for the tenant. + * + * @throws 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 resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope() { + final String expand = null; + return new PagedIterable<>(listAtTenantScopeAsync(expand)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope(String expand, Context context) { + return new PagedIterable<>(listAtTenantScopeAsync(expand, context)); } /** @@ -168,18 +291,18 @@ public Mono> unregisterWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.unregister(this.client.getEndpoint(), resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.unregister(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceProviderNamespace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -200,18 +323,18 @@ private Mono> unregisterWithResponseAsync(String resourc return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.unregister(this.client.getEndpoint(), resourceProviderNamespace, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.unregister(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceProviderNamespace, accept, context); } /** @@ -262,8 +385,8 @@ public ProviderInner unregister(String resourceProviderNamespace) { * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -283,10 +406,9 @@ public Mono> registerAtManagementGroupScopeWithResponseAsync(Stri if (groupId == null) { return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil .withContext(context -> service.registerAtManagementGroupScope(this.client.getEndpoint(), - resourceProviderNamespace, this.client.getApiVersion(), groupId, accept, context)) + this.client.getApiVersion(), resourceProviderNamespace, groupId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -295,8 +417,8 @@ public Mono> registerAtManagementGroupScopeWithResponseAsync(Stri * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -317,10 +439,9 @@ private Mono> registerAtManagementGroupScopeWithResponseAsync(Str if (groupId == null) { return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.registerAtManagementGroupScope(this.client.getEndpoint(), resourceProviderNamespace, - this.client.getApiVersion(), groupId, accept, context); + return service.registerAtManagementGroupScope(this.client.getEndpoint(), this.client.getApiVersion(), + resourceProviderNamespace, groupId, context); } /** @@ -328,8 +449,8 @@ private Mono> registerAtManagementGroupScopeWithResponseAsync(Str * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -346,8 +467,8 @@ public Mono registerAtManagementGroupScopeAsync(String resourceProviderNam * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -365,8 +486,8 @@ public Response registerAtManagementGroupScopeWithResponse(String resource * resource types that can be deployed at the management group scope. It does not recursively register subscriptions * within the management group. Instead, you must register subscriptions individually. * - * @param resourceProviderNamespace The namespace of the resource provider to register. - * @param groupId The management group ID. + * @param resourceProviderNamespace The management group ID.The namespace of the resource provider to register. + * @param groupId The groupId parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -392,18 +513,18 @@ public void registerAtManagementGroupScope(String resourceProviderNamespace, Str return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.providerPermissions(this.client.getEndpoint(), resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.providerPermissions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceProviderNamespace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -424,18 +545,18 @@ public void registerAtManagementGroupScope(String resourceProviderNamespace, Str return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.providerPermissions(this.client.getEndpoint(), resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.providerPermissions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceProviderNamespace, accept, context); } /** @@ -500,21 +621,21 @@ public Mono> registerWithResponseAsync(String resourcePr return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } if (properties != null) { properties.validate(); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.register(this.client.getEndpoint(), resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), properties, accept, context)) + .withContext(context -> service.register(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceProviderNamespace, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -536,21 +657,21 @@ private Mono> registerWithResponseAsync(String resourceP return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required 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 (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } if (properties != null) { properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.register(this.client.getEndpoint(), resourceProviderNamespace, this.client.getApiVersion(), - this.client.getSubscriptionId(), properties, accept, context); + return service.register(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceProviderNamespace, accept, properties, context); } /** @@ -625,7 +746,7 @@ private Mono> listSinglePageAsync(String expand) { } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), expand, this.client.getApiVersion(), + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), expand, this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -658,7 +779,7 @@ private Mono> listSinglePageAsync(String expand, Co final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), expand, this.client.getApiVersion(), this.client.getSubscriptionId(), + .list(this.client.getEndpoint(), this.client.getApiVersion(), expand, this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -741,139 +862,6 @@ public PagedIterable list(String expand, Context context) { return new PagedIterable<>(listAsync(expand, context)); } - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync(String expand) { - 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.listAtTenantScope(this.client.getEndpoint(), expand, - 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 all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeSinglePageAsync(String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAtTenantScope(this.client.getEndpoint(), expand, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync(String expand) { - return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for the tenant. - * - * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAtTenantScopeAsync() { - final String expand = null; - return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource providers for the tenant as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAtTenantScopeAsync(String expand, Context context) { - return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(expand, context), - nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all resource providers for the tenant. - * - * @throws 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 resource providers for the tenant as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope() { - final String expand = null; - return new PagedIterable<>(listAtTenantScopeAsync(expand)); - } - - /** - * Gets all resource providers for the tenant. - * - * @param expand The properties to include in the results. For example, use &$expand=metadata in the query - * string to retrieve resource provider metadata. To include property aliases in response, use - * $expand=resourceTypes/aliases. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource providers for the tenant as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAtTenantScope(String expand, Context context) { - return new PagedIterable<>(listAtTenantScopeAsync(expand, context)); - } - /** * Gets the specified resource provider. * @@ -901,8 +889,8 @@ public Mono> getWithResponseAsync(String resourceProvide } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), expand, resourceProviderNamespace, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), expand, + resourceProviderNamespace, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -935,7 +923,7 @@ private Mono> getWithResponseAsync(String resourceProvid } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), expand, resourceProviderNamespace, this.client.getApiVersion(), + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), expand, resourceProviderNamespace, this.client.getSubscriptionId(), accept, context); } @@ -1011,8 +999,8 @@ public Mono> getAtTenantScopeWithResponseAsync(String re } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), expand, - resourceProviderNamespace, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), + expand, resourceProviderNamespace, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1042,8 +1030,8 @@ private Mono> getAtTenantScopeWithResponseAsync(String r } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtTenantScope(this.client.getEndpoint(), expand, resourceProviderNamespace, - this.client.getApiVersion(), accept, context); + return service.getAtTenantScope(this.client.getEndpoint(), this.client.getApiVersion(), expand, + resourceProviderNamespace, accept, context); } /** @@ -1102,11 +1090,11 @@ public ProviderInner getAtTenantScope(String resourceProviderNamespace) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resource providers for a subscription along with {@link PagedResponse} on successful completion of + * @return all resource providers for the tenant along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1115,7 +1103,8 @@ private Mono> listNextSinglePageAsync(String nextLi 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)) + return FluxUtil + .withContext(context -> service.listAtTenantScopeNext(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())); @@ -1129,11 +1118,11 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resource providers for a subscription along with {@link PagedResponse} on successful completion of + * @return all resource providers for the tenant along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1143,7 +1132,7 @@ private Mono> listNextSinglePageAsync(String nextLi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1155,11 +1144,11 @@ private Mono> listNextSinglePageAsync(String nextLi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of + * @return all resource providers for a subscription along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1168,8 +1157,7 @@ private Mono> listAtTenantScopeNextSinglePageAsync( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, context)) + 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())); @@ -1183,11 +1171,11 @@ private Mono> listAtTenantScopeNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resource providers for the tenant along with {@link PagedResponse} on successful completion of + * @return all resource providers for a subscription along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAtTenantScopeNextSinglePageAsync(String nextLink, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1197,7 +1185,7 @@ private Mono> listAtTenantScopeNextSinglePageAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listAtTenantScopeNext(nextLink, this.client.getEndpoint(), accept, 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/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java index ce1c668cf58a..969b560de75d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -37,8 +37,8 @@ import com.azure.resourcemanager.resources.fluent.ResourceGroupsClient; import com.azure.resourcemanager.resources.fluent.models.ResourceGroupExportResultInner; import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; +import com.azure.resourcemanager.resources.implementation.models.ResourceGroupListResult; import com.azure.resourcemanager.resources.models.ExportTemplateRequest; -import com.azure.resourcemanager.resources.models.ResourceGroupListResult; import com.azure.resourcemanager.resources.models.ResourceGroupPatchable; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,145 +73,244 @@ public final class ResourceGroupsClientImpl implements ResourceGroupsClient { * The interface defining all the services for ResourceManagementClientResourceGroups to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ResourceManagementClientResourceGroups") public interface ResourceGroupsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> checkExistence(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourceGroupInner parameters, @HeaderParam("Accept") String accept, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ResourceGroupInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ResourceGroupPatchable parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("forceDeletionTypes") String forceDeletionTypes, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @QueryParam("forceDeletionTypes") String forceDeletionTypes, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @Get("/subscriptions/{subscriptionId}/resourcegroups") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourceGroupPatchable parameters, @HeaderParam("Accept") String accept, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> exportTemplate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ExportTemplateRequest parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + Mono>> exportTemplate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ExportTemplateRequest parameters, + 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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Checks whether a resource group exists. + * Gets a resource group. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource group along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync(String resourceGroupName) { + public Mono> getWithResponseAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkExistence(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accept, context); } /** - * Checks whether a resource group exists. + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName) { + return getWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a resource group. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupInner get(String resourceGroupName) { + return getWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync(String resourceGroupName, Context context) { + public Mono> checkExistenceWithResponseAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + return FluxUtil + .withContext(context -> service.checkExistence(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } context = this.client.mergeContext(context); - return service.checkExistence(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.checkExistence(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, context); } /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -225,7 +324,7 @@ public Mono checkExistenceAsync(String resourceGroupName) { /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -240,7 +339,7 @@ public Response checkExistenceWithResponse(String resourceGroupName, Co /** * Checks whether a resource group exists. * - * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -254,9 +353,7 @@ public boolean checkExistence(String resourceGroupName) { /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -270,32 +367,31 @@ public Mono> createOrUpdateWithResponseAsync(String return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -310,31 +406,30 @@ private Mono> createOrUpdateWithResponseAsync(Strin return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, parameters, context); } /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -350,9 +445,7 @@ public Mono createOrUpdateAsync(String resourceGroupName, Re /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -369,9 +462,7 @@ public Response createOrUpdateWithResponse(String resourceGr /** * Creates or updates a resource group. * - * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, - * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed - * characters. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters supplied to the create or update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -384,109 +475,245 @@ public ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroup } /** - * Deletes a resource group. + * Updates a resource group. * - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is - * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, - String forceDeletionTypes) { + public Mono> updateWithResponseAsync(String resourceGroupName, + ResourceGroupPatchable parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, forceDeletionTypes, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a resource group. + * Updates a resource group. * - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is - * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String forceDeletionTypes, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, + ResourceGroupPatchable parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, forceDeletionTypes, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, contentType, accept, parameters, context); } /** - * Deletes a resource group. + * Updates a resource group. * - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. - * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is - * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return resource group information on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String forceDeletionTypes) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, forceDeletionTypes); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters) { + return updateWithResponseAsync(resourceGroupName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a resource group. + * Updates a resource group. * - * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of - * its template deployments and currently stored operations. + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, ResourceGroupPatchable parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, parameters, context).block(); + } + + /** + * Updates a resource group. + * + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is + * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters) { + return updateWithResponse(resourceGroupName, parameters, Context.NONE).getValue(); + } + + /** + * Deletes a resource group. + * + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of + * its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String forceDeletionTypes) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, forceDeletionTypes, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource group. + * + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of + * its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String forceDeletionTypes, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, forceDeletionTypes, context); + } + + /** + * Deletes a resource group. + * + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of + * its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String forceDeletionTypes) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, forceDeletionTypes); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a resource group. + * + * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of + * its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, Void> beginDeleteAsync(String resourceGroupName) { @@ -502,7 +729,7 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -526,7 +753,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -544,7 +771,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName) * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -565,7 +792,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -585,7 +812,7 @@ public Mono deleteAsync(String resourceGroupName, String forceDeletionType * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -604,7 +831,7 @@ public Mono deleteAsync(String resourceGroupName) { * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -625,7 +852,7 @@ private Mono deleteAsync(String resourceGroupName, String forceDeletionTyp * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -642,7 +869,7 @@ public void delete(String resourceGroupName) { * When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all of * its template deployments and currently stored operations. * - * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. * @param context The context to associate with this operation. @@ -656,248 +883,151 @@ public void delete(String resourceGroupName, String forceDeletionTypes, Context } /** - * Gets a resource group. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group along with {@link Response} on successful completion of {@link Mono}. + * @return all the resource groups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName) { + private Mono> listSinglePageAsync(String filter, Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a resource group. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group along with {@link Response} on successful completion of {@link Mono}. + * @return all the resource groups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, Context context) { + private Mono> listSinglePageAsync(String filter, Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName) { - return getWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a resource group. - * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, Context context) { - return getWithResponseAsync(resourceGroupName, context).block(); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, top, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets a resource group. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource group. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupInner get(String resourceGroupName) { - return getWithResponse(resourceGroupName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(String resourceGroupName, - ResourceGroupPatchable parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - ResourceGroupPatchable parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information on successful completion of {@link Mono}. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters) { - return updateWithResponseAsync(resourceGroupName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); } /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * Gets all the resource groups for a subscription. * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, ResourceGroupPatchable parameters, - Context context) { - return updateWithResponseAsync(resourceGroupName, parameters, context).block(); - } - - /** - * Updates a resource group. - * - * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is - * the same as that for creating a resource group. If a field is unspecified, the current value is retained. - * - * @param resourceGroupName The name of the resource group to update. The name is case insensitive. - * @param parameters Parameters supplied to update a resource group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource group information. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters) { - return updateWithResponse(resourceGroupName, parameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); } /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -924,17 +1054,18 @@ public Mono>> exportTemplateWithResponseAsync(String r } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.exportTemplate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.exportTemplate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -962,16 +1093,17 @@ private Mono>> exportTemplateWithResponseAsync(String } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.exportTemplate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), parameters, accept, context); + return service.exportTemplate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, contentType, accept, parameters, context); } /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -990,7 +1122,7 @@ private Mono>> exportTemplateWithResponseAsync(String /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1011,7 +1143,7 @@ private Mono>> exportTemplateWithResponseAsync(String /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1027,7 +1159,7 @@ private Mono>> exportTemplateWithResponseAsync(String /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1044,7 +1176,7 @@ private Mono>> exportTemplateWithResponseAsync(String /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1061,7 +1193,7 @@ public Mono exportTemplateAsync(String resourceG /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1079,7 +1211,7 @@ private Mono exportTemplateAsync(String resource /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1094,7 +1226,7 @@ public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, E /** * Captures the specified resource group as a template. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for exporting the template. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1108,148 +1240,6 @@ public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, E return exportTemplateAsync(resourceGroupName, parameters, context).block(); } - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource groups for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource groups for a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Integer top, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource groups for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource groups for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, top)); - } - - /** - * Gets all the resource groups for a subscription. - * - * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. - * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. - * @param top The number of results to return. If null is passed, returns all resource groups. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resource groups for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Integer top, Context context) { - return new PagedIterable<>(listAsync(filter, top, context)); - } - /** * Get the next page of items. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java index 1358522bd662..e7ddff624ed6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { ResourceManagementClientImpl.class }) public final class ResourceManagementClientBuilder { /* - * The Microsoft Azure subscription ID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The Microsoft Azure subscription ID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the ResourceManagementClientBuilder. */ - public ResourceManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public ResourceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the ResourceManagementClientBuilder. */ - public ResourceManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public ResourceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public ResourceManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); ResourceManagementClientImpl client = new ResourceManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java index 72b000b66097..1fe47051d905 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -24,26 +24,12 @@ @ServiceClient(builder = ResourceManagementClientBuilder.class) public final class ResourceManagementClientImpl extends AzureServiceClient implements ResourceManagementClient { /** - * The Microsoft Azure subscription ID. - */ - private final String subscriptionId; - - /** - * Gets The Microsoft Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -52,12 +38,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -65,6 +51,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -122,73 +122,73 @@ public OperationsClient getOperations() { } /** - * The ProvidersClient object to access its operations. + * The ResourceGroupsClient object to access its operations. */ - private final ProvidersClient providers; + private final ResourceGroupsClient resourceGroups; /** - * Gets the ProvidersClient object to access its operations. + * Gets the ResourceGroupsClient object to access its operations. * - * @return the ProvidersClient object. + * @return the ResourceGroupsClient object. */ - public ProvidersClient getProviders() { - return this.providers; + public ResourceGroupsClient getResourceGroups() { + return this.resourceGroups; } /** - * The ProviderResourceTypesClient object to access its operations. + * The ResourcesClient object to access its operations. */ - private final ProviderResourceTypesClient providerResourceTypes; + private final ResourcesClient resources; /** - * Gets the ProviderResourceTypesClient object to access its operations. + * Gets the ResourcesClient object to access its operations. * - * @return the ProviderResourceTypesClient object. + * @return the ResourcesClient object. */ - public ProviderResourceTypesClient getProviderResourceTypes() { - return this.providerResourceTypes; + public ResourcesClient getResources() { + return this.resources; } /** - * The ResourcesClient object to access its operations. + * The TagOperationsClient object to access its operations. */ - private final ResourcesClient resources; + private final TagOperationsClient tagOperations; /** - * Gets the ResourcesClient object to access its operations. + * Gets the TagOperationsClient object to access its operations. * - * @return the ResourcesClient object. + * @return the TagOperationsClient object. */ - public ResourcesClient getResources() { - return this.resources; + public TagOperationsClient getTagOperations() { + return this.tagOperations; } /** - * The ResourceGroupsClient object to access its operations. + * The ProvidersClient object to access its operations. */ - private final ResourceGroupsClient resourceGroups; + private final ProvidersClient providers; /** - * Gets the ResourceGroupsClient object to access its operations. + * Gets the ProvidersClient object to access its operations. * - * @return the ResourceGroupsClient object. + * @return the ProvidersClient object. */ - public ResourceGroupsClient getResourceGroups() { - return this.resourceGroups; + public ProvidersClient getProviders() { + return this.providers; } /** - * The TagOperationsClient object to access its operations. + * The ProviderResourceTypesClient object to access its operations. */ - private final TagOperationsClient tagOperations; + private final ProviderResourceTypesClient providerResourceTypes; /** - * Gets the TagOperationsClient object to access its operations. + * Gets the ProviderResourceTypesClient object to access its operations. * - * @return the TagOperationsClient object. + * @return the ProviderResourceTypesClient object. */ - public TagOperationsClient getTagOperations() { - return this.tagOperations; + public ProviderResourceTypesClient getProviderResourceTypes() { + return this.providerResourceTypes; } /** @@ -198,23 +198,23 @@ public TagOperationsClient getTagOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The Microsoft Azure subscription ID. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ ResourceManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2025-04-01"; this.operations = new OperationsClientImpl(this); - this.providers = new ProvidersClientImpl(this); - this.providerResourceTypes = new ProviderResourceTypesClientImpl(this); - this.resources = new ResourcesClientImpl(this); this.resourceGroups = new ResourceGroupsClientImpl(this); + this.resources = new ResourcesClientImpl(this); this.tagOperations = new TagOperationsClientImpl(this); + this.providers = new ProvidersClientImpl(this); + this.providerResourceTypes = new ProviderResourceTypesClientImpl(this); } } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java index 0d5496997418..c0e7a0f737d1 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -55,17 +55,16 @@ public final class ResourceNamesClientImpl implements ResourceNamesClient { * The interface defining all the services for SubscriptionClientResourceNames to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "SubscriptionClientResourceNames") public interface ResourceNamesService { @Headers({ "Content-Type: application/json" }) @Post("/providers/Microsoft.Resources/checkResourceName") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkResourceName(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ResourceName resourceNameDefinition, @HeaderParam("Accept") String accept, - Context context); + Mono> checkResourceName(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ResourceName resourceNameDefinition, Context context); } /** @@ -74,7 +73,7 @@ Mono> checkResourceName(@HostParam("$host * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with * a reserved word. * - * @param resourceNameDefinition Resource object with values for resource name and resource type. + * @param resourceNameDefinition The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -94,7 +93,7 @@ Mono> checkResourceName(@HostParam("$host final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkResourceName(this.client.getEndpoint(), this.client.getApiVersion(), - resourceNameDefinition, accept, context)) + accept, resourceNameDefinition, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -104,7 +103,7 @@ Mono> checkResourceName(@HostParam("$host * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with * a reserved word. * - * @param resourceNameDefinition Resource object with values for resource name and resource type. + * @param resourceNameDefinition The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -124,8 +123,8 @@ Mono> checkResourceName(@HostParam("$host } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkResourceName(this.client.getEndpoint(), this.client.getApiVersion(), resourceNameDefinition, - accept, context); + return service.checkResourceName(this.client.getEndpoint(), this.client.getApiVersion(), accept, + resourceNameDefinition, context); } /** @@ -152,7 +151,7 @@ public Mono checkResourceNameAsync() { * A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with * a reserved word. * - * @param resourceNameDefinition Resource object with values for resource name and resource type. + * @param resourceNameDefinition The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java index 14939f7f42bd..e2f043c5f795 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -38,7 +38,7 @@ import com.azure.resourcemanager.resources.fluent.models.GenericResourceExpandedInner; import com.azure.resourcemanager.resources.fluent.models.GenericResourceInner; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; -import com.azure.resourcemanager.resources.models.ResourceListResult; +import com.azure.resourcemanager.resources.implementation.models.ResourceListResult; import com.azure.resourcemanager.resources.models.ResourcesMoveInfo; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,162 +73,161 @@ public final class ResourcesClientImpl implements InnerSupportsListing> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources") + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{sourceResourceGroupName}/moveResources") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> moveResources(@HostParam("$host") String endpoint, - @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + Mono>> moveResources(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourcesMoveInfo parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ResourcesMoveInfo parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources") + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{sourceResourceGroupName}/validateMoveResources") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> validateMoveResources(@HostParam("$host") String endpoint, - @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + Mono>> validateMoveResources(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ResourcesMoveInfo parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") ResourcesMoveInfo parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Head("/{resourceId}") + @ExpectedResponses({ 204, 404 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceById(@HostParam("endpoint") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resources") + @Get("/{resourceId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + Mono> getById(@HostParam("endpoint") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Put("/{resourceId}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateById(@HostParam("endpoint") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GenericResourceInner parameters, + Context context); + + @Patch("/{resourceId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateById(@HostParam("endpoint") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") GenericResourceInner parameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{resourceId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteById(@HostParam("endpoint") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") @ExpectedResponses({ 204, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistence(@HostParam("$host") String endpoint, + Mono> checkExistence(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, @PathParam(value = "resourceType", encoded = true) String resourceType, @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, @PathParam(value = "resourceType", encoded = true) String resourceType, @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, @PathParam(value = "resourceType", encoded = true) String resourceType, @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") GenericResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenericResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, @PathParam(value = "resourceType", encoded = true) String resourceType, @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") GenericResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenericResourceInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceProviderNamespace") String resourceProviderNamespace, @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, @PathParam(value = "resourceType", encoded = true) String resourceType, @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Head("/{resourceId}") - @ExpectedResponses({ 204, 404 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkExistenceById(@HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/{resourceId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteById(@HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{resourceId}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateById(@HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenericResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/{resourceId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateById(@HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GenericResourceInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}") + @Get("/subscriptions/{subscriptionId}/resources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getById(@HostParam("$host") String endpoint, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @QueryParam("$expand") String expand, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -236,13 +235,13 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -271,18 +270,18 @@ Mono> listNext(@PathParam(value = "nextLink", encod return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, filter, - expand, top, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, top, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -291,7 +290,7 @@ Mono> listNext(@PathParam(value = "nextLink", encod /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -321,19 +320,19 @@ private Mono> listByResourceGroupSin return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, filter, expand, top, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, expand, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -341,7 +340,7 @@ private Mono> listByResourceGroupSin /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -372,7 +371,7 @@ public PagedFlux listByResourceGroupAsync(String r /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -390,7 +389,7 @@ public PagedFlux listByResourceGroupAsync(String r /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -423,7 +422,7 @@ private PagedFlux listByResourceGroupAsync(String /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -440,7 +439,7 @@ public PagedIterable listByResourceGroup(String re /** * Get all the resources for a resource group. * - * @param resourceGroupName The resource group with the resources to get. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For example, to @@ -476,8 +475,7 @@ public PagedIterable listByResourceGroup(String re * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -491,23 +489,23 @@ public Mono>> moveResourcesWithResponseAsync(String so return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (sourceResourceGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required 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 (sourceResourceGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.moveResources(this.client.getEndpoint(), sourceResourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.moveResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), sourceResourceGroupName, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -519,8 +517,7 @@ public Mono>> moveResourcesWithResponseAsync(String so * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -535,23 +532,23 @@ private Mono>> moveResourcesWithResponseAsync(String s return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (sourceResourceGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required 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 (sourceResourceGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service.moveResources(this.client.getEndpoint(), sourceResourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + return service.moveResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), sourceResourceGroupName, contentType, parameters, context); } /** @@ -562,8 +559,7 @@ private Mono>> moveResourcesWithResponseAsync(String s * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -586,8 +582,7 @@ public PollerFlux, Void> beginMoveResourcesAsync(String sourceR * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -613,8 +608,7 @@ private PollerFlux, Void> beginMoveResourcesAsync(String source * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -635,8 +629,7 @@ public SyncPoller, Void> beginMoveResources(String sourceResour * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -658,8 +651,7 @@ public SyncPoller, Void> beginMoveResources(String sourceResour * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -680,8 +672,7 @@ public Mono moveResourcesAsync(String sourceResourceGroupName, ResourcesMo * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -704,8 +695,7 @@ private Mono moveResourcesAsync(String sourceResourceGroupName, ResourcesM * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -724,8 +714,7 @@ public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo para * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups * until the move completes. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be moved. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -746,8 +735,7 @@ public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo para * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -761,23 +749,24 @@ public Mono>> validateMoveResourcesWithResponseAsync(S return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (sourceResourceGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required 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 (sourceResourceGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.validateMoveResources(this.client.getEndpoint(), sourceResourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext( + context -> service.validateMoveResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), sourceResourceGroupName, contentType, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -790,8 +779,7 @@ public Mono>> validateMoveResourcesWithResponseAsync(S * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -806,23 +794,23 @@ private Mono>> validateMoveResourcesWithResponseAsync( return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (sourceResourceGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter sourceResourceGroupName is required 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 (sourceResourceGroupName == null) { + return Mono.error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service.validateMoveResources(this.client.getEndpoint(), sourceResourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.validateMoveResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), sourceResourceGroupName, contentType, parameters, context); } /** @@ -834,8 +822,7 @@ private Mono>> validateMoveResourcesWithResponseAsync( * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -860,8 +847,7 @@ public PollerFlux, Void> beginValidateMoveResourcesAsync(String * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -888,8 +874,7 @@ private PollerFlux, Void> beginValidateMoveResourcesAsync(Strin * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -911,8 +896,7 @@ public SyncPoller, Void> beginValidateMoveResources(String sour * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -935,8 +919,7 @@ public SyncPoller, Void> beginValidateMoveResources(String sour * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -958,8 +941,7 @@ public Mono validateMoveResourcesAsync(String sourceResourceGroupName, Res * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -983,8 +965,7 @@ private Mono validateMoveResourcesAsync(String sourceResourceGroupName, Re * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1004,8 +985,7 @@ public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveI * fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location * header value to check the result of the long-running operation. * - * @param sourceResourceGroupName The name of the resource group from the source subscription containing the - * resources to be validated for move. + * @param sourceResourceGroupName The name of the resource group to get. The name is case insensitive. * @param parameters Parameters for moving resources. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1018,801 +998,486 @@ public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveI } /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resources in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String expand, - Integer top) { + public Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), filter, expand, top, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext( + context -> service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resources in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, String expand, - Integer top, Context context) { + private Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), filter, expand, top, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, context); } /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resources in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String filter, String expand, Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all the resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription as paginated response with {@link PagedFlux}. + * @return whether resource exists on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkExistenceByIdAsync(String resourceId, String apiVersion) { + return checkExistenceByIdWithResponseAsync(resourceId, apiVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resources in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, String expand, Integer top, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all the resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + * @return whether resource exists along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - final String expand = null; - final Integer top = null; - return new PagedIterable<>(listAsync(filter, expand, top)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context) { + return checkExistenceByIdWithResponseAsync(resourceId, apiVersion, context).block(); } /** - * Get all the resources in a subscription. + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. * - * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` - * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, - * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, - * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use - * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, - * property)` can be used to filter for substrings of the following currently-supported properties: `name` and - * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, - * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined - * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may - * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names - * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq - * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each - * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` - * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources - * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will - * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, - * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering - * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and - * plan/name`, and `identity and identity/principalId`. - * @param expand Comma-separated list of additional properties to be included in the response. Valid values include - * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. - * @param top The number of recommendations per page if a paged version of this API is being used. - * @param context The context to associate with this operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 resources in a subscription as paginated response with {@link PagedIterable}. + * @return whether resource exists. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, String expand, Integer top, - Context context) { - return new PagedIterable<>(listAsync(filter, expand, top, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceById(String resourceId, String apiVersion) { + return checkExistenceByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); } /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion) { + public Mono> getByIdWithResponseAsync(String resourceId, String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkExistence(this.client.getEndpoint(), resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, Context context) { + private Mono> getByIdWithResponseAsync(String resourceId, String apiVersion, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistence(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), accept, - context); + return service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); } /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. + * @return a resource by ID on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return checkExistenceWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getByIdAsync(String resourceId, String apiVersion) { + return getByIdWithResponseAsync(resourceId, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response}. + * @return a resource by ID along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceWithResponse(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { - return checkExistenceWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, apiVersion, context).block(); + public Response getByIdWithResponse(String resourceId, String apiVersion, Context context) { + return getByIdWithResponseAsync(resourceId, apiVersion, context).block(); } /** - * Checks whether a resource exists. + * Gets a resource by ID. * - * @param resourceGroupName The name of the resource group containing the resource to check. The name is case - * insensitive. - * @param resourceProviderNamespace The resource provider of the resource to check. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to check whether it exists. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. + * @return a resource by ID. */ @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion) { - return checkExistenceWithResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, apiVersion, Context.NONE).getValue(); + public GenericResourceInner getById(String resourceId, String apiVersion) { + return getByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion) { + public Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, Context context) { + private Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), accept, - context); + return service.createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, contentType, accept, + parameters, context); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, GenericResourceInner> + beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) { + Mono>> mono = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, Context context) { + private PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono + = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GenericResourceInner.class, GenericResourceInner.class, context); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return this - .beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion) - .getSyncPoller(); + public SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters) { + return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { - return this - .beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, context) - .getSyncPoller(); + public SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters, Context context) { + return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion) { - return beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + GenericResourceInner parameters) { + return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { - return beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + GenericResourceInner parameters, Context context) { + return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion) { - deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, - apiVersion).block(); + public GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, + GenericResourceInner parameters) { + return createOrUpdateByIdAsync(resourceId, apiVersion, parameters).block(); } /** - * Deletes a resource. + * Create a resource by ID. * - * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case - * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type. - * @param resourceName The name of the resource to delete. - * @param apiVersion The API version to use for the operation. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, - String resourceType, String resourceName, String apiVersion, Context context) { - deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, - apiVersion, context).block(); + public GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, + GenericResourceInner parameters, Context context) { + return createOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).block(); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters) { + public Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.updateById(this.client.getEndpoint(), resourceId, apiVersion, contentType, + accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1820,85 +1485,55 @@ public Mono>> createOrUpdateWithResponseAsync(String r * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters, Context context) { + private Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, + GenericResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), parameters, - accept, context); + return service.updateById(this.client.getEndpoint(), resourceId, apiVersion, contentType, accept, parameters, + context); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters); + public PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, + String apiVersion, GenericResourceInner parameters) { + Mono>> mono = updateByIdWithResponseAsync(resourceId, apiVersion, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1906,51 +1541,38 @@ public PollerFlux, GenericResourceInner> beginC * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { + private PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, + String apiVersion, GenericResourceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, context); + Mono>> mono + = updateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters) - .getSyncPoller(); + public SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters) { + return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1958,48 +1580,35 @@ public SyncPoller, GenericResourceInner> beginC * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginCreateOrUpdate( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters, context) - .getSyncPoller(); + public SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, + String apiVersion, GenericResourceInner parameters, Context context) { + return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, + public Mono updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters).last().flatMap(this.client::getLroFinalResultOrError); + return beginUpdateByIdAsync(resourceId, apiVersion, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2007,46 +1616,34 @@ public Mono createOrUpdateAsync(String resourceGroupName, * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, + private Mono updateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters, context).last().flatMap(this.client::getLroFinalResultOrError); + return beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters) { - return createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters).block(); + public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters) { + return updateByIdAsync(resourceId, apiVersion, parameters).block(); } /** - * Creates a resource. + * Update a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to create. - * @param resourceName The name of the resource to create. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for creating or updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2054,355 +1651,222 @@ public GenericResourceInner createOrUpdate(String resourceGroupName, String reso * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters, context).block(); + public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters, + Context context) { + return updateByIdAsync(resourceId, apiVersion, parameters, context).block(); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters) { + public Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, - resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters, Context context) { + private Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceProviderNamespace == null) { - return Mono.error( - new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); - } - if (parentResourcePath == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), parameters, - accept, context); + return service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, context); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GenericResourceInner> beginUpdateAsync(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion) { + Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GenericResourceInner> beginUpdateAsync( - String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, - String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { + private PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - GenericResourceInner.class, GenericResourceInner.class, context); + Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters) { - return this - .beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters) - .getSyncPoller(); + public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion) { + return this.beginDeleteByIdAsync(resourceId, apiVersion).getSyncPoller(); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, - String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, - String apiVersion, GenericResourceInner parameters, Context context) { - return this - .beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters, context) - .getSyncPoller(); + public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context) { + return this.beginDeleteByIdAsync(resourceId, apiVersion, context).getSyncPoller(); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters) { - return beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteByIdAsync(String resourceId, String apiVersion) { + return beginDeleteByIdAsync(resourceId, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, parameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteByIdAsync(String resourceId, String apiVersion, Context context) { + return beginDeleteByIdAsync(resourceId, apiVersion, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters) { - return updateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, - apiVersion, parameters).block(); + public void deleteById(String resourceId, String apiVersion) { + deleteByIdAsync(resourceId, apiVersion).block(); } /** - * Updates a resource. + * Deletes a resource by ID. * - * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. - * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource to update. - * @param resourceName The name of the resource to update. - * @param apiVersion The API version to use for the operation. - * @param parameters Parameters for updating the resource. + * @param resourceId The resourceId parameter. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion, - GenericResourceInner parameters, Context context) { - return updateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, - apiVersion, parameters, context).block(); + public void deleteById(String resourceId, String apiVersion, Context context) { + deleteByIdAsync(resourceId, apiVersion, context).block(); } /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource along with {@link Response} on successful completion of {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, + public Mono> checkExistenceWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -2424,42 +1888,41 @@ public Mono> getWithResponseAsync(String resource if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, - parentResourcePath, resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), accept, - context)) + .withContext(context -> service.checkExistence(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource along with {@link Response} on successful completion of {@link Mono}. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, + private Mono> checkExistenceWithResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -2481,460 +1944,661 @@ private Mono> getWithResponseAsync(String resourc if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, resourceProviderNamespace, parentResourcePath, - resourceType, resourceName, apiVersion, this.client.getSubscriptionId(), accept, context); + return service.checkExistence(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, context); } /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource on successful completion of {@link Mono}. + * @return whether resource exists on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String resourceProviderNamespace, + public Mono checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return getWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return checkExistenceWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource along with {@link Response}. + * @return whether resource exists along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceProviderNamespace, + public Response checkExistenceWithResponse(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { - return getWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, context).block(); + return checkExistenceWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, apiVersion, context).block(); } /** - * Gets a resource. + * Checks whether a resource exists. * * @param resourceGroupName The name of the resource group containing the resource to get. The name is case * insensitive. - * @param resourceProviderNamespace The namespace of the resource provider. + * @param resourceProviderNamespace The resource provider of the resource to check. * @param parentResourcePath The parent resource identity. - * @param resourceType The resource type of the resource. - * @param resourceName The name of the resource to get. - * @param apiVersion The API version to use for the operation. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource. + * @return whether resource exists. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, - String parentResourcePath, String resourceType, String resourceName, String apiVersion) { - return getWithResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, - resourceName, apiVersion, Context.NONE).getValue(); + public boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion) { + return checkExistenceWithResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, + resourceType, resourceName, apiVersion, Context.NONE).getValue(); } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion) { + public Mono> getWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + * @return a resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, accept, context); } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. + * @return a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkExistenceByIdAsync(String resourceId, String apiVersion) { - return checkExistenceByIdWithResponseAsync(resourceId, apiVersion) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return getWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response}. + * @return a resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context) { - return checkExistenceByIdWithResponseAsync(resourceId, apiVersion, context).block(); + public Response getWithResponse(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { + return getWithResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, context).block(); } /** - * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In - * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then - * is to use the GET API to check for the existence of the resource. + * Gets a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. + * @return a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkExistenceById(String resourceId, String apiVersion) { - return checkExistenceByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); + public GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return getWithResponse(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, Context.NONE).getValue(); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion) { + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required 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 (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a resource by ID. - * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteByIdWithResponseAsync(String resourceId, String apiVersion, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, contentType, accept, + parameters, context); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion) { - Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteByIdAsync(String resourceId, String apiVersion, - Context context) { + private PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + GenericResourceInner.class, GenericResourceInner.class, context); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion) { - return this.beginDeleteByIdAsync(resourceId, apiVersion).getSyncPoller(); + public SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters) + .getSyncPoller(); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteById(String resourceId, String apiVersion, Context context) { - return this.beginDeleteByIdAsync(resourceId, apiVersion, context).getSyncPoller(); + public SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters, context) + .getSyncPoller(); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteByIdAsync(String resourceId, String apiVersion) { - return beginDeleteByIdAsync(resourceId, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteByIdAsync(String resourceId, String apiVersion, Context context) { - return beginDeleteByIdAsync(resourceId, apiVersion, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteById(String resourceId, String apiVersion) { - deleteByIdAsync(resourceId, apiVersion).block(); + public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters).block(); } /** - * Deletes a resource by ID. + * Creates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteById(String resourceId, String apiVersion, Context context) { - deleteByIdAsync(resourceId, apiVersion, context).block(); + public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, + GenericResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters, context).block(); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, - GenericResourceInner parameters) { + public Mono>> updateWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required 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 (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, - parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2942,14 +2606,34 @@ public Mono>> createOrUpdateByIdWithResponseAsync(Stri * @return resource information along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateByIdWithResponseAsync(String resourceId, String apiVersion, - GenericResourceInner parameters, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); @@ -2959,41 +2643,51 @@ private Mono>> createOrUpdateByIdWithResponseAsync(Str } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, - context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, contentType, accept, + parameters, context); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GenericResourceInner> - beginCreateOrUpdateByIdAsync(String resourceId, String apiVersion, GenericResourceInner parameters) { - Mono>> mono = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters); + public PollerFlux, GenericResourceInner> beginUpdateAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, GenericResourceInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, apiVersion, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3001,42 +2695,53 @@ private Mono>> createOrUpdateByIdWithResponseAsync(Str * @return the {@link PollerFlux} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( - String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + private PollerFlux, GenericResourceInner> beginUpdateAsync( + String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, + String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, apiVersion, parameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + public SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { - return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); + return this + .beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters) + .getSyncPoller(); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3044,39 +2749,50 @@ public SyncPoller, GenericResourceInner> beginC * @return the {@link SyncPoller} for polling of resource information. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginCreateOrUpdateById(String resourceId, + public SyncPoller, GenericResourceInner> beginUpdate(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { - return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); + return this + .beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters, context) + .getSyncPoller(); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + public Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + return beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3084,39 +2800,48 @@ public Mono createOrUpdateByIdAsync(String resourceId, Str * @return resource information on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateByIdAsync(String resourceId, String apiVersion, + private Mono updateAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { - return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return beginUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, parameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, + public GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { - return createOrUpdateByIdAsync(resourceId, apiVersion, parameters).block(); + return updateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, parameters).block(); } /** - * Create a resource by ID. + * Updates a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Create or update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. + * @param parameters Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -3124,360 +2849,554 @@ public GenericResourceInner createOrUpdateById(String resourceId, String apiVers * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, + public GenericResourceInner update(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, Context context) { - return createOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).block(); + return updateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, parameters, context).block(); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, - GenericResourceInner parameters) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (apiVersion == null) { return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, - accept, context)) + .withContext( + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateByIdWithResponseAsync(String resourceId, String apiVersion, - GenericResourceInner parameters, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono.error( + new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, context); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, - String apiVersion, GenericResourceInner parameters) { - Mono>> mono = updateByIdWithResponseAsync(resourceId, apiVersion, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - GenericResourceInner.class, GenericResourceInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, apiVersion); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GenericResourceInner> beginUpdateByIdAsync(String resourceId, - String apiVersion, GenericResourceInner parameters, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, + String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, + String apiVersion, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = updateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - GenericResourceInner.class, GenericResourceInner.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceProviderNamespace, + parentResourcePath, resourceType, resourceName, apiVersion, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, - String apiVersion, GenericResourceInner parameters) { - return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return this + .beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion) + .getSyncPoller(); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 resource information. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GenericResourceInner> beginUpdateById(String resourceId, - String apiVersion, GenericResourceInner parameters, Context context) { - return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { + return this + .beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, context) + .getSyncPoller(); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateByIdAsync(String resourceId, String apiVersion, - GenericResourceInner parameters) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion) { + return beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateByIdAsync(String resourceId, String apiVersion, - GenericResourceInner parameters, Context context) { - return beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String apiVersion, Context context) { + return beginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, + resourceName, apiVersion, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters) { - return updateByIdAsync(resourceId, apiVersion, parameters).block(); + public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion) { + deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion).block(); } /** - * Updates a resource by ID. + * Deletes a resource. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. - * @param parameters Update resource parameters. + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for this operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters, - Context context) { - return updateByIdAsync(resourceId, apiVersion, parameters, context).block(); + public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, + String resourceType, String resourceName, String apiVersion, Context context) { + deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, + apiVersion, context).block(); } /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. + * @return all the resources in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByIdWithResponseAsync(String resourceId, String apiVersion) { + private Mono> listSinglePageAsync(String filter, String expand, + Integer top) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, expand, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID along with {@link Response} on successful completion of {@link Mono}. + * @return all the resources in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByIdWithResponseAsync(String resourceId, String apiVersion, - Context context) { + private Mono> listSinglePageAsync(String filter, String expand, + Integer top, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (apiVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), filter, + expand, top, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID on successful completion of {@link Mono}. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByIdAsync(String resourceId, String apiVersion) { - return getByIdWithResponseAsync(resourceId, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String filter, String expand, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @throws 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 resources in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID along with {@link Response}. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByIdWithResponse(String resourceId, String apiVersion, Context context) { - return getByIdWithResponseAsync(resourceId, apiVersion, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String expand, Integer top, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, expand, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Gets a resource by ID. + * Get all the resources in a subscription. * - * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the - * format, - * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. - * @param apiVersion The API version to use for the operation. + * @throws 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 resources in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, expand, top)); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, `name`, + * `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, `plan/name`, + * `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a resource type, use + * `$filter=resourceType eq 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, + * property)` can be used to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource name, + * use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be combined + * using `and`/`or` operators.<br><br>Note that any truncated number of results queried via `$top` may + * also not be compatible when using a filter.<br><br><br>Resources can be filtered by tag names + * and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and tagValue eq + * 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original tags for each + * resource will not be returned in the results.</b> Any list of additional properties queried via `$expand` + * may also not be compatible when filtering by tag names/values. <br><br>For tag names only, resources + * can be filtered by prefix using the following syntax: `$filter=startswith(tagName, 'depart')`. This query will + * return all resources with a tag name prefixed by the phrase `depart` (i.e.`department`, `departureDate`, + * `departureTime`, etc.)<br><br><br>Note that some properties can be combined when filtering + * resources, which include the following: `substringof() and/or resourceType`, `plan and plan/publisher and + * plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a resource by ID. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GenericResourceInner getById(String resourceId, String apiVersion) { - return getByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, String expand, Integer top, + Context context) { + return new PagedIterable<>(listAsync(filter, expand, top, context)); } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java index 46f45ab2fbae..500991fe8780 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { SubscriptionClientImpl.class }) public final class SubscriptionClientBuilder { /* - * server parameter + * Service host */ private String endpoint; /** - * Sets server parameter. + * Sets Service host. * * @param endpoint the endpoint value. * @return the SubscriptionClientBuilder. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java index da0b72345591..f4ff719e0691 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -21,12 +21,12 @@ @ServiceClient(builder = SubscriptionClientBuilder.class) public final class SubscriptionClientImpl extends AzureServiceClient implements SubscriptionClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -35,12 +35,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -139,7 +139,7 @@ public ResourceNamesClient getResourceNames() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param endpoint server parameter. + * @param endpoint Service host. */ SubscriptionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionFeatureRegistrationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionFeatureRegistrationsClientImpl.java index 924cdec27a48..bf3b32acf31b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionFeatureRegistrationsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionFeatureRegistrationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java index 4a037926c80f..b9e79887e62f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -31,9 +31,9 @@ import com.azure.resourcemanager.resources.fluent.models.CheckZonePeersResultInner; import com.azure.resourcemanager.resources.fluent.models.LocationInner; import com.azure.resourcemanager.resources.fluent.models.SubscriptionInner; +import com.azure.resourcemanager.resources.implementation.models.LocationListResult; +import com.azure.resourcemanager.resources.implementation.models.SubscriptionListResult; import com.azure.resourcemanager.resources.models.CheckZonePeersRequest; -import com.azure.resourcemanager.resources.models.LocationListResult; -import com.azure.resourcemanager.resources.models.SubscriptionListResult; import reactor.core.publisher.Mono; /** @@ -65,15 +65,15 @@ public final class SubscriptionsClientImpl implements SubscriptionsClient { * The interface defining all the services for SubscriptionClientSubscriptions to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "SubscriptionClientSubscriptions") public interface SubscriptionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/locations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLocations(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> listLocations(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("includeExtendedLocations") Boolean includeExtendedLocations, @HeaderParam("Accept") String accept, Context context); @@ -81,32 +81,39 @@ Mono> listLocations(@HostParam("$host") String endp @Get("/subscriptions/{subscriptionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/checkZonePeers/") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkZonePeers(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckZonePeersRequest parameters, @HeaderParam("Accept") String accept, - Context context); + Mono> checkZonePeers(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckZonePeersRequest parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listLocationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -115,12 +122,15 @@ Mono> listNext(@PathParam(value = "nextLink", e * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response along with {@link PagedResponse} on successful completion of + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -135,10 +145,10 @@ private Mono> listLocationsSinglePageAsync(String s } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listLocations(this.client.getEndpoint(), subscriptionId, - this.client.getApiVersion(), includeExtendedLocations, accept, context)) + .withContext(context -> service.listLocations(this.client.getEndpoint(), this.client.getApiVersion(), + subscriptionId, includeExtendedLocations, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -148,13 +158,16 @@ private Mono> listLocationsSinglePageAsync(String s * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response along with {@link PagedResponse} on successful completion of + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -170,10 +183,10 @@ private Mono> listLocationsSinglePageAsync(String s final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listLocations(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), + .listLocations(this.client.getEndpoint(), this.client.getApiVersion(), subscriptionId, includeExtendedLocations, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -182,16 +195,20 @@ private Mono> listLocationsSinglePageAsync(String s * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedFlux}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listLocationsAsync(String subscriptionId, Boolean includeExtendedLocations) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations)); + return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations), + nextLink -> listLocationsNextSinglePageAsync(nextLink)); } /** @@ -200,16 +217,20 @@ public PagedFlux listLocationsAsync(String subscriptionId, Boolea * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedFlux}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listLocationsAsync(String subscriptionId) { final Boolean includeExtendedLocations = null; - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations)); + return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations), + nextLink -> listLocationsNextSinglePageAsync(nextLink)); } /** @@ -218,18 +239,22 @@ public PagedFlux listLocationsAsync(String subscriptionId) { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedFlux}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listLocationsAsync(String subscriptionId, Boolean includeExtendedLocations, Context context) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations, context)); + return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, includeExtendedLocations, context), + nextLink -> listLocationsNextSinglePageAsync(nextLink, context)); } /** @@ -238,11 +263,14 @@ private PagedFlux listLocationsAsync(String subscriptionId, Boole * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedIterable}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listLocations(String subscriptionId) { @@ -256,13 +284,16 @@ public PagedIterable listLocations(String subscriptionId) { * This operation provides all the locations that are available for resource providers; however, each resource * provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param includeExtendedLocations Whether to include extended locations. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return location list operation response as paginated response with {@link PagedIterable}. + * @return all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listLocations(String subscriptionId, Boolean includeExtendedLocations, @@ -273,7 +304,7 @@ public PagedIterable listLocations(String subscriptionId, Boolean /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -291,7 +322,7 @@ public Mono> getWithResponseAsync(String subscriptio } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), subscriptionId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -299,7 +330,7 @@ public Mono> getWithResponseAsync(String subscriptio /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -318,13 +349,13 @@ private Mono> getWithResponseAsync(String subscripti } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), subscriptionId, accept, context); } /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -338,7 +369,7 @@ public Mono getAsync(String subscriptionId) { /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -353,7 +384,7 @@ public Response getWithResponse(String subscriptionId, Contex /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -464,8 +495,8 @@ public PagedIterable list(Context context) { /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -487,18 +518,19 @@ public Mono> checkZonePeersWithResponseAsync } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkZonePeers(this.client.getEndpoint(), subscriptionId, - this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.checkZonePeers(this.client.getEndpoint(), this.client.getApiVersion(), + subscriptionId, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -521,17 +553,18 @@ private Mono> checkZonePeersWithResponseAsyn } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkZonePeers(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), - parameters, accept, context); + return service.checkZonePeers(this.client.getEndpoint(), this.client.getApiVersion(), subscriptionId, + contentType, accept, parameters, context); } /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -547,8 +580,8 @@ public Mono checkZonePeersAsync(String subscriptionId /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -564,8 +597,8 @@ public Response checkZonePeersWithResponse(String sub /** * Compares a subscriptions logical zone mapping. * - * @param subscriptionId The ID of the target subscription. - * @param parameters Parameters for checking zone peers. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -576,6 +609,70 @@ public CheckZonePeersResultInner checkZonePeers(String subscriptionId, CheckZone return checkZonePeersWithResponse(subscriptionId, parameters, Context.NONE).getValue(); } + /** + * Gets all available geo-locations. + * + * 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 all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLocationsNextSinglePageAsync(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.listLocationsNext(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())); + } + + /** + * Gets all available geo-locations. + * + * 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 all available geo-locations. + * + * This operation provides all the locations that are available for resource providers; however, each resource + * provider may support a subset of this list along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLocationsNextSinglePageAsync(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.listLocationsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + /** * Get the next page of items. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java index efd8ffe269fd..bc066fef811f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -36,7 +36,7 @@ import com.azure.resourcemanager.resources.fluent.models.TagDetailsInner; import com.azure.resourcemanager.resources.fluent.models.TagValueInner; import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; -import com.azure.resourcemanager.resources.models.TagsListResult; +import com.azure.resourcemanager.resources.implementation.models.TagsListResult; import com.azure.resourcemanager.resources.models.TagsPatchResource; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -71,735 +71,690 @@ public final class TagOperationsClientImpl implements TagOperationsClient { * The interface defining all the services for ResourceManagementClientTagOperations to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "ResourceManagementClientTagOperations") public interface TagOperationsService { @Headers({ "Content-Type: application/json" }) + @Get("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Accept") String accept, Context context); + + @Put("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsResourceInner parameters, Context context); + + @Patch("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") TagsPatchResource parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtScope(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteValue(@HostParam("$host") String endpoint, @PathParam("tagName") String tagName, - @PathParam("tagValue") String tagValue, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> deleteValue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("tagName") String tagName, + @PathParam("tagValue") String tagValue, @PathParam("subscriptionId") String subscriptionId, + Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateValue(@HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, @PathParam("tagValue") String tagValue, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdateValue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("tagName") String tagName, + @PathParam("tagValue") String tagValue, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("tagName") String tagName, @QueryParam("api-version") String apiVersion, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("tagName") String tagName, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @PathParam("tagName") String tagName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("tagName") String tagName, + @PathParam("subscriptionId") String subscriptionId, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/tagNames") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsResourceInner parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TagsPatchResource parameters, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Resources/tags/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAtScope(@HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, @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); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteValueWithResponseAsync(String tagName, String tagValue) { + public Mono> getAtScopeWithResponseAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteValue(this.client.getEndpoint(), tagName, tagValue, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteValueWithResponseAsync(String tagName, String tagValue, Context context) { + private Mono> getAtScopeWithResponseAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteValue(this.client.getEndpoint(), tagName, tagValue, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.getAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); } /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the entire set of tags on a resource or subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteValueAsync(String tagName, String tagValue) { - return deleteValueWithResponseAsync(tagName, tagValue).flatMap(ignored -> Mono.empty()); + public Mono getAtScopeAsync(String scope) { + return getAtScopeWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the entire set of tags on a resource or subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteValueWithResponse(String tagName, String tagValue, Context context) { - return deleteValueWithResponseAsync(tagName, tagValue, context).block(); + public Response getAtScopeWithResponse(String scope, Context context) { + return getAtScopeWithResponseAsync(scope, context).block(); } /** - * Deletes a predefined tag value for a predefined tag name. - * - * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. - * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * Gets the entire set of tags on a resource or subscription. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to delete. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteValue(String tagName, String tagValue) { - deleteValueWithResponse(tagName, tagValue, Context.NONE); + public TagsResourceInner getAtScope(String scope) { + return getAtScopeWithResponse(scope, Context.NONE).getValue(); } /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information along with {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue) { + public Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, + TagsResourceInner parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateValue(this.client.getEndpoint(), tagName, tagValue, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.createOrUpdateAtScope(this.client.getEndpoint(), + this.client.getApiVersion(), scope, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information along with {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue, - Context context) { + private Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, + TagsResourceInner parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (tagValue == null) { - return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateValue(this.client.getEndpoint(), tagName, tagValue, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.createOrUpdateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, + accept, parameters, context); } /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateValueAsync(String tagName, String tagValue) { - return createOrUpdateValueWithResponseAsync(tagName, tagValue).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, + TagsResourceInner parameters) { + Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagsResourceInner.class, TagsResourceInner.class, this.client.getContext()); } /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information along with {@link Response}. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context) { - return createOrUpdateValueWithResponseAsync(tagName, tagValue, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, + TagsResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagsResourceInner.class, TagsResourceInner.class, context); } /** - * Creates a predefined value for a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag - * value can have a maximum of 256 characters. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag. - * @param tagValue The value of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag information. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TagValueInner createOrUpdateValue(String tagName, String tagValue) { - return createOrUpdateValueWithResponse(tagName, tagValue, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, + TagsResourceInner parameters) { + return this.beginCreateOrUpdateAtScopeAsync(scope, parameters).getSyncPoller(); } /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateWithResponseAsync(String tagName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), tagName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, + TagsResourceInner parameters, Context context) { + return this.beginCreateOrUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); } /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details along with {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String tagName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), tagName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + public Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters) { + return beginCreateOrUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String tagName) { - return createOrUpdateWithResponseAsync(tagName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters, + Context context) { + return beginCreateOrUpdateAtScopeAsync(scope, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details along with {@link Response}. + * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String tagName, Context context) { - return createOrUpdateWithResponseAsync(tagName, context).block(); + public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters) { + return createOrUpdateAtScopeAsync(scope, parameters).block(); } /** - * Creates a predefined tag name. + * Creates or updates the entire set of tags on a resource or subscription. * - * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name - * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which - * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The + * specified entity can have a maximum of 50 tags. * - * @param tagName The name of the tag to create. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return tag details. + * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagDetailsInner createOrUpdate(String tagName) { - return createOrUpdateWithResponse(tagName, Context.NONE).getValue(); + public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context) { + return createOrUpdateAtScopeAsync(scope, parameters, context).block(); } /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync(String tagName) { + public Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), tagName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.updateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String tagName, Context context) { + private Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (tagName == null) { - return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), tagName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.updateAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, contentType, accept, + parameters, context); } /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String tagName) { - return deleteWithResponseAsync(tagName).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, + TagsPatchResource parameters) { + Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagsResourceInner.class, TagsResourceInner.class, this.client.getContext()); } /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String tagName, Context context) { - return deleteWithResponseAsync(tagName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, + TagsPatchResource parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TagsResourceInner.class, TagsResourceInner.class, context); } /** - * Deletes a predefined tag name. + * Selectively updates the set of tags on a resource or subscription. * - * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name - * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must - * have already been deleted. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param tagName The name of the tag. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String tagName) { - deleteWithResponse(tagName, Context.NONE); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, + TagsPatchResource parameters) { + return this.beginUpdateAtScopeAsync(scope, parameters).getSyncPoller(); } /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, + TagsPatchResource parameters, Context context) { + return this.beginUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); } /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * - * @param context The context to associate with this operation. + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a summary of tag usage under the subscription. - * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. - * - * @throws 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 subscription tags as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + public Mono updateAtScopeAsync(String scope, TagsPatchResource parameters) { + return beginUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags as paginated response with {@link PagedFlux}. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAtScopeAsync(String scope, TagsPatchResource parameters, Context context) { + return beginUpdateAtScopeAsync(scope, parameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags as paginated response with {@link PagedIterable}. + * @return wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters) { + return updateAtScopeAsync(scope, parameters).block(); } /** - * Gets a summary of tag usage under the subscription. + * Selectively updates the set of tags on a resource or subscription. * - * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and - * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of - * tags, this operation may return a previously cached result. + * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the + * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the + * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or + * name/value pairs. * + * @param scope The fully qualified Azure Resource manager identifier of the resource. + * @param parameters The parameters parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags as paginated response with {@link PagedIterable}. + * @return wrapper resource for tags API requests and responses. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context) { + return updateAtScopeAsync(scope, parameters, context).block(); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, - TagsResourceInner parameters) { + public Mono>> deleteAtScopeWithResponseAsync(String scope) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -807,36 +762,23 @@ public Mono>> createOrUpdateAtScopeWithResponseAsync(S if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateAtScope(this.client.getEndpoint(), scope, - this.client.getApiVersion(), parameters, accept, context)) + return FluxUtil.withContext( + context -> service.deleteAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, - TagsResourceInner parameters, Context context) { + private Mono>> deleteAtScopeWithResponseAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -844,695 +786,773 @@ private Mono>> createOrUpdateAtScopeWithResponseAsync( if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdateAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, - accept, context); + return service.deleteAtScope(this.client.getEndpoint(), this.client.getApiVersion(), scope, context); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, - TagsResourceInner parameters) { - Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagsResourceInner.class, TagsResourceInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteAtScopeAsync(String scope) { + Mono>> mono = deleteAtScopeWithResponseAsync(scope); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of wrapper resource for tags API requests and responses. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync(String scope, - TagsResourceInner parameters, Context context) { + private PollerFlux, Void> beginDeleteAtScopeAsync(String scope, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagsResourceInner.class, TagsResourceInner.class, context); + Mono>> mono = deleteAtScopeWithResponseAsync(scope, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, - TagsResourceInner parameters) { - return this.beginCreateOrUpdateAtScopeAsync(scope, parameters).getSyncPoller(); + public SyncPoller, Void> beginDeleteAtScope(String scope) { + return this.beginDeleteAtScopeAsync(scope).getSyncPoller(); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope(String scope, - TagsResourceInner parameters, Context context) { - return this.beginCreateOrUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); + public SyncPoller, Void> beginDeleteAtScope(String scope, Context context) { + return this.beginDeleteAtScopeAsync(scope, context).getSyncPoller(); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters) { - return beginCreateOrUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteAtScopeAsync(String scope) { + return beginDeleteAtScopeAsync(scope).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters, - Context context) { - return beginCreateOrUpdateAtScopeAsync(scope, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAtScopeAsync(String scope, Context context) { + return beginDeleteAtScopeAsync(scope, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters) { - return createOrUpdateAtScopeAsync(scope, parameters).block(); + public void deleteAtScope(String scope) { + deleteAtScopeAsync(scope).block(); } /** - * Creates or updates the entire set of tags on a resource or subscription. - * - * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The - * specified entity can have a maximum of 50 tags. + * Deletes the entire set of tags on a resource or subscription. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param scope The fully qualified Azure Resource manager identifier of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context) { - return createOrUpdateAtScopeAsync(scope, parameters, context).block(); + public void deleteAtScope(String scope, Context context) { + deleteAtScopeAsync(scope, context).block(); } /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters) { + public Mono> deleteValueWithResponseAsync(String tagName, String tagValue) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - parameters, accept, context)) + .withContext(context -> service.deleteValue(this.client.getEndpoint(), this.client.getApiVersion(), tagName, + tagValue, this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateAtScopeWithResponseAsync(String scope, TagsPatchResource parameters, - Context context) { + private Mono> deleteValueWithResponseAsync(String tagName, String tagValue, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, - context); + return service.deleteValue(this.client.getEndpoint(), this.client.getApiVersion(), tagName, tagValue, + this.client.getSubscriptionId(), context); } /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, - TagsPatchResource parameters) { - Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagsResourceInner.class, TagsResourceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteValueAsync(String tagName, String tagValue) { + return deleteValueWithResponseAsync(tagName, tagValue).flatMap(ignored -> Mono.empty()); } /** - * Selectively updates the set of tags on a resource or subscription. + * Deletes a predefined tag value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync(String scope, - TagsPatchResource parameters, Context context) { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteValueWithResponse(String tagName, String tagValue, Context context) { + return deleteValueWithResponseAsync(tagName, tagValue, context).block(); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteValue(String tagName, String tagValue) { + deleteValueWithResponse(tagName, tagValue, Context.NONE); + } + + /** + * Creates a predefined value for a predefined tag name. + * + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateValue(this.client.getEndpoint(), this.client.getApiVersion(), + tagName, tagValue, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a predefined value for a predefined tag name. + * + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); - Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TagsResourceInner.class, TagsResourceInner.class, context); + return service.createOrUpdateValue(this.client.getEndpoint(), this.client.getApiVersion(), tagName, tagValue, + this.client.getSubscriptionId(), accept, context); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + * @return tag information on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, - TagsPatchResource parameters) { - return this.beginUpdateAtScopeAsync(scope, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateValueAsync(String tagName, String tagValue) { + return createOrUpdateValueWithResponseAsync(tagName, tagValue).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + * @return tag information along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TagsResourceInner> beginUpdateAtScope(String scope, - TagsPatchResource parameters, Context context) { - return this.beginUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context) { + return createOrUpdateValueWithResponseAsync(tagName, tagValue, context).block(); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined value for a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag + * value can have a maximum of 256 characters. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return tag information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAtScopeAsync(String scope, TagsPatchResource parameters) { - return beginUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); + public TagValueInner createOrUpdateValue(String tagName, String tagValue) { + return createOrUpdateValueWithResponse(tagName, tagValue, Context.NONE).getValue(); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync(String tagName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + tagName, this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a predefined tag name. + * + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + * @return tag details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAtScopeAsync(String scope, TagsPatchResource parameters, Context context) { - return beginUpdateAtScopeAsync(scope, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> createOrUpdateWithResponseAsync(String tagName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), tagName, + this.client.getSubscriptionId(), accept, context); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. * - * @param scope The resource scope. - * @param parameters The parameters parameter. + * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. + * @return tag details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters) { - return updateAtScopeAsync(scope, parameters).block(); + public Mono createOrUpdateAsync(String tagName) { + return createOrUpdateWithResponseAsync(tagName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Selectively updates the set of tags on a resource or subscription. + * Creates a predefined tag name. * - * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. - * The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the - * entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the - * values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or - * name/value pairs. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String tagName, Context context) { + return createOrUpdateWithResponseAsync(tagName, context).block(); + } + + /** + * Creates a predefined tag name. * - * @param scope The resource scope. - * @param parameters The parameters parameter. - * @param context The context to associate with this operation. + * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return wrapper resource for tags API requests and responses. + * @return tag details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context) { - return updateAtScopeAsync(scope, parameters, context).block(); + public TagDetailsInner createOrUpdate(String tagName) { + return createOrUpdateWithResponse(tagName, Context.NONE).getValue(); } /** - * Gets the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAtScopeWithResponseAsync(String scope) { + public Mono> deleteWithResponseAsync(String tagName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), tagName, + this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. * - * @param scope The resource scope. + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. + * + * @param tagName The name of the tag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion - * of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAtScopeWithResponseAsync(String scope, Context context) { + private Mono> deleteWithResponseAsync(String tagName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), tagName, + this.client.getSubscriptionId(), context); } /** - * Gets the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAtScopeAsync(String scope) { - return getAtScopeWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String tagName) { + return deleteWithResponseAsync(tagName).flatMap(ignored -> Mono.empty()); } /** - * Gets the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAtScopeWithResponse(String scope, Context context) { - return getAtScopeWithResponseAsync(scope, context).block(); + public Response deleteWithResponse(String tagName, Context context) { + return deleteWithResponseAsync(tagName, context).block(); } /** - * Gets the entire set of tags on a resource or subscription. + * Deletes a predefined tag name. + * + * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name + * being deleted must not be in use as a tag name for any resource. All predefined values for the given name must + * have already been deleted. * - * @param scope The resource scope. + * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the entire set of tags on a resource or subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TagsResourceInner getAtScope(String scope) { - return getAtScopeWithResponse(scope, Context.NONE).getValue(); + public void delete(String tagName) { + deleteWithResponse(tagName, Context.NONE); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteAtScopeWithResponseAsync(String scope) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteAtScopeWithResponseAsync(String scope, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAtScopeAsync(String scope) { - Mono>> mono = deleteAtScopeWithResponseAsync(scope); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the entire set of tags on a resource or subscription. + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAtScopeAsync(String scope, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteAtScopeWithResponseAsync(scope, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes the entire set of tags on a resource or subscription. + * @return a summary of tag usage under the subscription. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtScope(String scope) { - return this.beginDeleteAtScopeAsync(scope).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAtScope(String scope, Context context) { - return this.beginDeleteAtScopeAsync(scope, context).getSyncPoller(); - } - - /** - * Deletes the entire set of tags on a resource or subscription. + * @return a summary of tag usage under the subscription. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAtScopeAsync(String scope) { - return beginDeleteAtScopeAsync(scope).last().flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. * - * @param scope The resource scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAtScopeAsync(String scope, Context context) { - return beginDeleteAtScopeAsync(scope, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the entire set of tags on a resource or subscription. + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope) { - deleteAtScopeAsync(scope).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); } /** - * Deletes the entire set of tags on a resource or subscription. + * Gets a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription. In case of a large number of + * tags, this operation may return a previously cached result. * - * @param scope The resource scope. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAtScope(String scope, Context context) { - deleteAtScopeAsync(scope, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** @@ -1544,7 +1564,11 @@ public void deleteAtScope(String scope, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of subscription tags along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1572,7 +1596,11 @@ private Mono> listNextSinglePageAsync(String next * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 subscription tags along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a summary of tag usage under the subscription. + * + * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and + * returns a summary of usage for each tag name and value under the given subscription along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java index cfe03fe9cb2c..b9f83afd2e10 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.resources.fluent.TenantsClient; import com.azure.resourcemanager.resources.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.resources.models.TenantListResult; +import com.azure.resourcemanager.resources.implementation.models.TenantListResult; import reactor.core.publisher.Mono; /** @@ -58,14 +58,14 @@ public final class TenantsClientImpl implements TenantsClient { * The interface defining all the services for SubscriptionClientTenants to be used by the proxy service to perform * REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "SubscriptionClientTenants") public interface TenantsService { @Headers({ "Content-Type: application/json" }) @Get("/tenants") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -73,7 +73,7 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataPolicyManifestListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DataPolicyManifestListResult.java similarity index 71% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataPolicyManifestListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DataPolicyManifestListResult.java index b6c953932ff9..661f532c10ef 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataPolicyManifestListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DataPolicyManifestListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of data policy manifests. + * The response of a DataPolicyManifest list operation. */ -@Fluent +@Immutable public final class DataPolicyManifestListResult implements JsonSerializable { /* - * An array of data policy manifests. + * The DataPolicyManifest items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DataPolicyManifestListResult class. */ - public DataPolicyManifestListResult() { + private DataPolicyManifestListResult() { } /** - * Get the value property: An array of data policy manifests. + * Get the value property: The DataPolicyManifest items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of data policy manifests. - * - * @param value the value value to set. - * @return the DataPolicyManifestListResult object itself. - */ - public DataPolicyManifestListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the DataPolicyManifestListResult object itself. - */ - public DataPolicyManifestListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataPolicyManifestListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DataPolicyManifestListResult.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DataPolicyManifestListResult 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 DataPolicyManifestListResult. */ public static DataPolicyManifestListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentListResult.java similarity index 73% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentListResult.java index 8dceb337e98c..63e7942d94ee 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of deployments. + * Paged collection of DeploymentExtended items. */ -@Fluent +@Immutable public final class DeploymentListResult implements JsonSerializable { /* - * An array of deployments. + * The DeploymentExtended items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DeploymentListResult class. */ - public DeploymentListResult() { + private DeploymentListResult() { } /** - * Get the value property: An array of deployments. + * Get the value property: The DeploymentExtended items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of deployments. - * - * @param value the value value to set. - * @return the DeploymentListResult object itself. - */ - public DeploymentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model DeploymentListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DeploymentListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DeploymentListResult 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 DeploymentListResult. */ public static DeploymentListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentOperationsListResult.java similarity index 74% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentOperationsListResult.java index 2bb20ef8c660..e64895b1eafb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationsListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentOperationsListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * List of deployment operations. */ -@Fluent +@Immutable public final class DeploymentOperationsListResult implements JsonSerializable { /* - * An array of deployment operations. + * The DeploymentOperation items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DeploymentOperationsListResult class. */ - public DeploymentOperationsListResult() { + private DeploymentOperationsListResult() { } /** - * Get the value property: An array of deployment operations. + * Get the value property: The DeploymentOperation items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of deployment operations. - * - * @param value the value value to set. - * @return the DeploymentOperationsListResult object itself. - */ - public DeploymentOperationsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DeploymentOperationsListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DeploymentOperationsListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +77,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DeploymentOperationsListResult 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 DeploymentOperationsListResult. */ public static DeploymentOperationsListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentStackListResult.java similarity index 73% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentStackListResult.java index 4a1b4a8b2c8a..9696183fd8b3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentStackListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of Deployment stacks. + * The response of a DeploymentStack list operation. */ -@Fluent +@Immutable public final class DeploymentStackListResult implements JsonSerializable { /* - * An array of Deployment stacks. + * The DeploymentStack items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of DeploymentStackListResult class. */ - public DeploymentStackListResult() { + private DeploymentStackListResult() { } /** - * Get the value property: An array of Deployment stacks. + * Get the value property: The DeploymentStack items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of Deployment stacks. - * - * @param value the value value to set. - * @return the DeploymentStackListResult object itself. - */ - public DeploymentStackListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,17 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model DeploymentStackListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(DeploymentStackListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +77,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of DeploymentStackListResult 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 DeploymentStackListResult. */ public static DeploymentStackListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/LocationListResult.java similarity index 79% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/LocationListResult.java index 12b4a22c85f4..ade2507750ed 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/LocationListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * Location list operation response. */ -@Fluent +@Immutable public final class LocationListResult implements JsonSerializable { /* * An array of locations. */ private List value; + /* + * The URL to get the next set of results. + */ + private String nextLink; + /** * Creates an instance of LocationListResult class. */ - public LocationListResult() { + private LocationListResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: An array of locations. + * Get the nextLink property: The URL to get the next set of results. * - * @param value the value value to set. - * @return the LocationListResult object itself. + * @return the nextLink value. */ - public LocationListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -88,6 +92,8 @@ public static LocationListResult fromJson(JsonReader jsonReader) throws IOExcept if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> LocationInner.fromJson(reader1)); deserializedLocationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocationListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/OperationListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..86fb1d092e94 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/OperationListResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.resources.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @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) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyAssignmentListResult.java similarity index 71% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyAssignmentListResult.java index 27ddb467d540..43b4acd9aece 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyAssignmentListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of policy assignments. + * The response of a PolicyAssignment list operation. */ -@Fluent +@Immutable public final class PolicyAssignmentListResult implements JsonSerializable { /* - * An array of policy assignments. + * The PolicyAssignment items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicyAssignmentListResult class. */ - public PolicyAssignmentListResult() { + private PolicyAssignmentListResult() { } /** - * Get the value property: An array of policy assignments. + * Get the value property: The PolicyAssignment items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of policy assignments. - * - * @param value the value value to set. - * @return the PolicyAssignmentListResult object itself. - */ - public PolicyAssignmentListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyAssignmentListResult object itself. - */ - public PolicyAssignmentListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PolicyAssignmentListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PolicyAssignmentListResult.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicyAssignmentListResult 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 PolicyAssignmentListResult. */ public static PolicyAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyDefinitionListResult.java similarity index 71% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyDefinitionListResult.java index 45aa09d8030b..49c6d15b099b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyDefinitionListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of policy definitions. + * The response of a PolicyDefinition list operation. */ -@Fluent +@Immutable public final class PolicyDefinitionListResult implements JsonSerializable { /* - * An array of policy definitions. + * The PolicyDefinition items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicyDefinitionListResult class. */ - public PolicyDefinitionListResult() { + private PolicyDefinitionListResult() { } /** - * Get the value property: An array of policy definitions. + * Get the value property: The PolicyDefinition items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of policy definitions. - * - * @param value the value value to set. - * @return the PolicyDefinitionListResult object itself. - */ - public PolicyDefinitionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicyDefinitionListResult object itself. - */ - public PolicyDefinitionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PolicyDefinitionListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PolicyDefinitionListResult.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicyDefinitionListResult 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 PolicyDefinitionListResult. */ public static PolicyDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicySetDefinitionListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicySetDefinitionListResult.java similarity index 71% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicySetDefinitionListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicySetDefinitionListResult.java index e0ec7418d419..90d0a0141c4a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicySetDefinitionListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicySetDefinitionListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of policy set definitions. + * The response of a PolicySetDefinition list operation. */ -@Fluent +@Immutable public final class PolicySetDefinitionListResult implements JsonSerializable { /* - * An array of policy set definitions. + * The PolicySetDefinition items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of PolicySetDefinitionListResult class. */ - public PolicySetDefinitionListResult() { + private PolicySetDefinitionListResult() { } /** - * Get the value property: An array of policy set definitions. + * Get the value property: The PolicySetDefinition items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of policy set definitions. - * - * @param value the value value to set. - * @return the PolicySetDefinitionListResult object itself. - */ - public PolicySetDefinitionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -63,28 +53,23 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the PolicySetDefinitionListResult object itself. - */ - public PolicySetDefinitionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PolicySetDefinitionListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(PolicySetDefinitionListResult.class); + /** * {@inheritDoc} */ @@ -102,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PolicySetDefinitionListResult 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 PolicySetDefinitionListResult. */ public static PolicySetDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ProviderListResult.java similarity index 74% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ProviderListResult.java index 79d549cb5d27..e5f04385f0ad 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ProviderListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * List of resource providers. */ -@Fluent +@Immutable public final class ProviderListResult implements JsonSerializable { /* - * An array of resource providers. + * The Provider items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ProviderListResult class. */ - public ProviderListResult() { + private ProviderListResult() { } /** - * Get the value property: An array of resource providers. + * Get the value property: The Provider items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of resource providers. - * - * @param value the value value to set. - * @return the ProviderListResult object itself. - */ - public ProviderListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ProviderListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ProviderListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProviderListResult 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 ProviderListResult. */ public static ProviderListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceGroupListResult.java similarity index 73% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceGroupListResult.java index 993894090812..d104f2dafcb9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceGroupListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of resource groups. + * The response of a ResourceGroup list operation. */ -@Fluent +@Immutable public final class ResourceGroupListResult implements JsonSerializable { /* - * An array of resource groups. + * The ResourceGroup items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ResourceGroupListResult class. */ - public ResourceGroupListResult() { + private ResourceGroupListResult() { } /** - * Get the value property: An array of resource groups. + * Get the value property: The ResourceGroup items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of resource groups. - * - * @param value the value value to set. - * @return the ResourceGroupListResult object itself. - */ - public ResourceGroupListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ResourceGroupListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ResourceGroupListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ResourceGroupListResult 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 ResourceGroupListResult. */ public static ResourceGroupListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceListResult.java similarity index 73% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceListResult.java index 56d4d25dbf27..2ceb1fe43552 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * List of resource groups. + * Paged collection of GenericResourceExpanded items. */ -@Fluent +@Immutable public final class ResourceListResult implements JsonSerializable { /* - * An array of resources. + * The GenericResourceExpanded items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ResourceListResult class. */ - public ResourceListResult() { + private ResourceListResult() { } /** - * Get the value property: An array of resources. + * Get the value property: The GenericResourceExpanded items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of resources. - * - * @param value the value value to set. - * @return the ResourceListResult object itself. - */ - public ResourceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ResourceListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ResourceListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ResourceListResult 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 ResourceListResult. */ public static ResourceListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/SubscriptionListResult.java similarity index 69% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/SubscriptionListResult.java index cecc7ba9e0e4..645bf593aea7 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/SubscriptionListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,26 +17,26 @@ /** * Subscription list operation response. */ -@Fluent +@Immutable public final class SubscriptionListResult implements JsonSerializable { /* - * An array of subscriptions. + * The Subscription items on this page */ private List value; /* - * The URL to get the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SubscriptionListResult class. */ - public SubscriptionListResult() { + private SubscriptionListResult() { } /** - * Get the value property: An array of subscriptions. + * Get the value property: The Subscription items on this page. * * @return the value value. */ @@ -45,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of subscriptions. - * - * @param value the value value to set. - * @return the SubscriptionListResult object itself. - */ - public SubscriptionListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,30 +53,17 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SubscriptionListResult object itself. - */ - public SubscriptionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (nextLink() == null) { + if (value() == null) { throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property nextLink in model SubscriptionListResult")); + .log(new IllegalArgumentException("Missing required property value in model SubscriptionListResult")); + } else { + value().forEach(e -> e.validate()); } } @@ -99,8 +75,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -120,11 +96,11 @@ public static SubscriptionListResult fromJson(JsonReader jsonReader) throws IOEx String fieldName = reader.getFieldName(); reader.nextToken(); - if ("nextLink".equals(fieldName)) { - deserializedSubscriptionListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { + if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> SubscriptionInner.fromJson(reader1)); deserializedSubscriptionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSubscriptionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TagsListResult.java similarity index 74% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TagsListResult.java index 37bb5d51bda8..76d2eb4c0855 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TagsListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,26 +17,26 @@ /** * List of subscription tags. */ -@Fluent +@Immutable public final class TagsListResult implements JsonSerializable { /* - * An array of tags. + * The TagDetails items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of TagsListResult class. */ - public TagsListResult() { + private TagsListResult() { } /** - * Get the value property: An array of tags. + * Get the value property: The TagDetails items on this page. * * @return the value value. */ @@ -44,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of tags. - * - * @param value the value value to set. - * @return the TagsListResult object itself. - */ - public TagsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -69,11 +59,16 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TagsListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(TagsListResult.class); + /** * {@inheritDoc} */ @@ -81,6 +76,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of TagsListResult 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 TagsListResult. */ public static TagsListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TenantListResult.java similarity index 70% rename from sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java rename to sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TenantListResult.java index 248adcb73937..33384687a4b6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/implementation/models/TenantListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.resources.models; +package com.azure.resourcemanager.resources.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,26 +17,26 @@ /** * Tenant Ids information. */ -@Fluent +@Immutable public final class TenantListResult implements JsonSerializable { /* - * An array of tenants. + * The TenantIdDescription items on this page */ private List value; /* - * The URL to use for getting the next set of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of TenantListResult class. */ - public TenantListResult() { + private TenantListResult() { } /** - * Get the value property: An array of tenants. + * Get the value property: The TenantIdDescription items on this page. * * @return the value value. */ @@ -45,18 +45,7 @@ public List value() { } /** - * Set the value property: An array of tenants. - * - * @param value the value value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,29 +53,17 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (nextLink() == null) { + if (value() == null) { throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property nextLink in model TenantListResult")); + .log(new IllegalArgumentException("Missing required property value in model TenantListResult")); + } else { + value().forEach(e -> e.validate()); } } @@ -98,8 +75,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -119,12 +96,12 @@ public static TenantListResult fromJson(JsonReader jsonReader) throws IOExceptio String fieldName = reader.getFieldName(); reader.nextToken(); - if ("nextLink".equals(fieldName)) { - deserializedTenantListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { + if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> TenantIdDescriptionInner.fromJson(reader1)); deserializedTenantListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTenantListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionOnUnmanage.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionOnUnmanage.java index 72c2b2cade2c..814fe782fd36 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionOnUnmanage.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionOnUnmanage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -18,20 +18,17 @@ @Fluent public final class ActionOnUnmanage implements JsonSerializable { /* - * Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach - * will leave the resource in it's current state. + * Specifies an action for a newly unmanaged resource. */ private DeploymentStacksDeleteDetachEnum resources; /* - * Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach - * will leave the resource in it's current state. + * Specifies an action for a newly unmanaged resource group. */ private DeploymentStacksDeleteDetachEnum resourceGroups; /* - * Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach - * will leave the resource in it's current state. + * Specifies an action for a newly unmanaged resource management group. */ private DeploymentStacksDeleteDetachEnum managementGroups; @@ -42,8 +39,7 @@ public ActionOnUnmanage() { } /** - * Get the resources property: Specifies an action for a newly unmanaged resource. Delete will attempt to delete the - * resource from Azure. Detach will leave the resource in it's current state. + * Get the resources property: Specifies an action for a newly unmanaged resource. * * @return the resources value. */ @@ -52,8 +48,7 @@ public DeploymentStacksDeleteDetachEnum resources() { } /** - * Set the resources property: Specifies an action for a newly unmanaged resource. Delete will attempt to delete the - * resource from Azure. Detach will leave the resource in it's current state. + * Set the resources property: Specifies an action for a newly unmanaged resource. * * @param resources the resources value to set. * @return the ActionOnUnmanage object itself. @@ -64,8 +59,7 @@ public ActionOnUnmanage withResources(DeploymentStacksDeleteDetachEnum resources } /** - * Get the resourceGroups property: Specifies an action for a newly unmanaged resource. Delete will attempt to - * delete the resource from Azure. Detach will leave the resource in it's current state. + * Get the resourceGroups property: Specifies an action for a newly unmanaged resource group. * * @return the resourceGroups value. */ @@ -74,8 +68,7 @@ public DeploymentStacksDeleteDetachEnum resourceGroups() { } /** - * Set the resourceGroups property: Specifies an action for a newly unmanaged resource. Delete will attempt to - * delete the resource from Azure. Detach will leave the resource in it's current state. + * Set the resourceGroups property: Specifies an action for a newly unmanaged resource group. * * @param resourceGroups the resourceGroups value to set. * @return the ActionOnUnmanage object itself. @@ -86,8 +79,7 @@ public ActionOnUnmanage withResourceGroups(DeploymentStacksDeleteDetachEnum reso } /** - * Get the managementGroups property: Specifies an action for a newly unmanaged resource. Delete will attempt to - * delete the resource from Azure. Detach will leave the resource in it's current state. + * Get the managementGroups property: Specifies an action for a newly unmanaged resource management group. * * @return the managementGroups value. */ @@ -96,8 +88,7 @@ public DeploymentStacksDeleteDetachEnum managementGroups() { } /** - * Set the managementGroups property: Specifies an action for a newly unmanaged resource. Delete will attempt to - * delete the resource from Azure. Detach will leave the resource in it's current state. + * Set the managementGroups property: Specifies an action for a newly unmanaged resource management group. * * @param managementGroups the managementGroups value to set. * @return the ActionOnUnmanage object itself. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionType.java new file mode 100644 index 000000000000..ecf4e91be465 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java index 23b0f3204997..650930c4f459 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Alias.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The alias type. */ -@Fluent +@Immutable public final class Alias implements JsonSerializable { /* * The alias name. @@ -50,7 +50,7 @@ public final class Alias implements JsonSerializable { /** * Creates an instance of Alias class. */ - public Alias() { + private Alias() { } /** @@ -62,17 +62,6 @@ public String name() { return this.name; } - /** - * Set the name property: The alias name. - * - * @param name the name value to set. - * @return the Alias object itself. - */ - public Alias withName(String name) { - this.name = name; - return this; - } - /** * Get the paths property: The paths for an alias. * @@ -82,17 +71,6 @@ public List paths() { return this.paths; } - /** - * Set the paths property: The paths for an alias. - * - * @param paths the paths value to set. - * @return the Alias object itself. - */ - public Alias withPaths(List paths) { - this.paths = paths; - return this; - } - /** * Get the type property: The type of the alias. * @@ -102,17 +80,6 @@ public AliasType type() { return this.type; } - /** - * Set the type property: The type of the alias. - * - * @param type the type value to set. - * @return the Alias object itself. - */ - public Alias withType(AliasType type) { - this.type = type; - return this; - } - /** * Get the defaultPath property: The default path for an alias. * @@ -122,17 +89,6 @@ public String defaultPath() { return this.defaultPath; } - /** - * Set the defaultPath property: The default path for an alias. - * - * @param defaultPath the defaultPath value to set. - * @return the Alias object itself. - */ - public Alias withDefaultPath(String defaultPath) { - this.defaultPath = defaultPath; - return this; - } - /** * Get the defaultPattern property: The default pattern for an alias. * @@ -142,17 +98,6 @@ public AliasPattern defaultPattern() { return this.defaultPattern; } - /** - * Set the defaultPattern property: The default pattern for an alias. - * - * @param defaultPattern the defaultPattern value to set. - * @return the Alias object itself. - */ - public Alias withDefaultPattern(AliasPattern defaultPattern) { - this.defaultPattern = defaultPattern; - return this; - } - /** * Get the defaultMetadata property: The default alias path metadata. Applies to the default path and to any alias * path that doesn't have metadata. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java index f91f26ffb59c..b603fee6337a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The type of the paths for alias. */ -@Fluent +@Immutable public final class AliasPath implements JsonSerializable { /* * The path of an alias. @@ -40,7 +40,7 @@ public final class AliasPath implements JsonSerializable { /** * Creates an instance of AliasPath class. */ - public AliasPath() { + private AliasPath() { } /** @@ -52,17 +52,6 @@ public String path() { return this.path; } - /** - * Set the path property: The path of an alias. - * - * @param path the path value to set. - * @return the AliasPath object itself. - */ - public AliasPath withPath(String path) { - this.path = path; - return this; - } - /** * Get the apiVersions property: The API versions. * @@ -72,17 +61,6 @@ public List apiVersions() { return this.apiVersions; } - /** - * Set the apiVersions property: The API versions. - * - * @param apiVersions the apiVersions value to set. - * @return the AliasPath object itself. - */ - public AliasPath withApiVersions(List apiVersions) { - this.apiVersions = apiVersions; - return this; - } - /** * Get the pattern property: The pattern for an alias path. * @@ -92,17 +70,6 @@ public AliasPattern pattern() { return this.pattern; } - /** - * Set the pattern property: The pattern for an alias path. - * - * @param pattern the pattern value to set. - * @return the AliasPath object itself. - */ - public AliasPath withPattern(AliasPattern pattern) { - this.pattern = pattern; - return this; - } - /** * Get the metadata property: The metadata of the alias path. If missing, fall back to the default metadata of the * alias. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java index 2040439d8b7c..f4b10f643e45 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class AliasPathAttributes extends ExpandableStringEnum { /** - * Static value None for AliasPathAttributes. + * The token that the alias path is referring to has no attributes. */ public static final AliasPathAttributes NONE = fromString("None"); /** - * Static value Modifiable for AliasPathAttributes. + * The token that the alias path is referring to is modifiable by policies with 'modify' effect. */ public static final AliasPathAttributes MODIFIABLE = fromString("Modifiable"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java index 98fb3a447205..0919596f28eb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -29,7 +29,7 @@ public final class AliasPathMetadata implements JsonSerializable { /** - * Static value NotSpecified for AliasPathTokenType. + * The token type is not specified. */ public static final AliasPathTokenType NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value Any for AliasPathTokenType. + * The token type can be anything. */ public static final AliasPathTokenType ANY = fromString("Any"); /** - * Static value String for AliasPathTokenType. + * The token type is string. */ public static final AliasPathTokenType STRING = fromString("String"); /** - * Static value Object for AliasPathTokenType. + * The token type is object. */ public static final AliasPathTokenType OBJECT = fromString("Object"); /** - * Static value Array for AliasPathTokenType. + * The token type is array. */ public static final AliasPathTokenType ARRAY = fromString("Array"); /** - * Static value Integer for AliasPathTokenType. + * The token type is integer. */ public static final AliasPathTokenType INTEGER = fromString("Integer"); /** - * Static value Number for AliasPathTokenType. + * The token type is number. */ public static final AliasPathTokenType NUMBER = fromString("Number"); /** - * Static value Boolean for AliasPathTokenType. + * The token type is boolean. */ public static final AliasPathTokenType BOOLEAN = fromString("Boolean"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java index 81325bc912c7..72cfc1f0a02a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The type of the pattern for an alias path. */ -@Fluent +@Immutable public final class AliasPattern implements JsonSerializable { /* * The alias pattern phrase. @@ -34,7 +34,7 @@ public final class AliasPattern implements JsonSerializable { /** * Creates an instance of AliasPattern class. */ - public AliasPattern() { + private AliasPattern() { } /** @@ -46,17 +46,6 @@ public String phrase() { return this.phrase; } - /** - * Set the phrase property: The alias pattern phrase. - * - * @param phrase the phrase value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withPhrase(String phrase) { - this.phrase = phrase; - return this; - } - /** * Get the variable property: The alias pattern variable. * @@ -66,17 +55,6 @@ public String variable() { return this.variable; } - /** - * Set the variable property: The alias pattern variable. - * - * @param variable the variable value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withVariable(String variable) { - this.variable = variable; - return this; - } - /** * Get the type property: The type of alias pattern. * @@ -86,17 +64,6 @@ public AliasPatternType type() { return this.type; } - /** - * Set the type property: The type of alias pattern. - * - * @param type the type value to set. - * @return the AliasPattern object itself. - */ - public AliasPattern withType(AliasPatternType type) { - this.type = type; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java index 2b887cb8d9cb..6a7351db2b3d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,12 +9,12 @@ */ public enum AliasPatternType { /** - * Enum value NotSpecified. + * NotSpecified is not allowed. */ NOT_SPECIFIED("NotSpecified"), /** - * Enum value Extract. + * Extract is the only allowed value. */ EXTRACT("Extract"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java index 83f124d5ce1a..738ebbd49178 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AliasType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,17 +9,17 @@ */ public enum AliasType { /** - * Enum value NotSpecified. + * Alias type is unknown (same as not providing alias type). */ NOT_SPECIFIED("NotSpecified"), /** - * Enum value PlainText. + * Alias value is not secret. */ PLAIN_TEXT("PlainText"), /** - * Enum value Mask. + * Alias value is secret. */ MASK("Mask"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java index c6a6cbfbfc74..9903da5d9554 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -29,7 +29,7 @@ public final class ApiProfile implements JsonSerializable { /** * Creates an instance of ApiProfile class. */ - public ApiProfile() { + private ApiProfile() { } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentScopeValidation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentScopeValidation.java index 33e36ce2e924..1724a0389705 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentScopeValidation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentScopeValidation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; @@ -23,7 +23,7 @@ public final class AssignmentScopeValidation extends ExpandableStringEnum values() { diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentType.java index 741cdb36803b..9d94e2f44d00 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AssignmentType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,22 +12,22 @@ */ public final class AssignmentType extends ExpandableStringEnum { /** - * Static value NotSpecified for AssignmentType. + * The not specified assignment type. */ public static final AssignmentType NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value System for AssignmentType. + * The system assignment type. */ public static final AssignmentType SYSTEM = fromString("System"); /** - * Static value SystemHidden for AssignmentType. + * The system hidden assignment type. */ public static final AssignmentType SYSTEM_HIDDEN = fromString("SystemHidden"); /** - * Static value Custom for AssignmentType. + * The custom assignment type. */ public static final AssignmentType CUSTOM = fromString("Custom"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AuthorizationProfile.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AuthorizationProfile.java index e42b69d6f6aa..d53785f0cf7b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AuthorizationProfile.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AuthorizationProfile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZoneMappings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZoneMappings.java index f63d1592f6ff..421d82f1bf09 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZoneMappings.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZoneMappings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -29,7 +29,7 @@ public final class AvailabilityZoneMappings implements JsonSerializable { /* * The availabilityZone. @@ -30,7 +30,7 @@ public final class AvailabilityZonePeers implements JsonSerializable peers() { return this.peers; } - /** - * Set the peers property: Details of shared availability zone. - * - * @param peers the peers value to set. - * @return the AvailabilityZonePeers object itself. - */ - public AvailabilityZonePeers withPeers(List peers) { - this.peers = peers; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AzureResourceBase.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AzureResourceBase.java deleted file mode 100644 index 3efeb6d1dde1..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/AzureResourceBase.java +++ /dev/null @@ -1,145 +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.resources.models; - -import com.azure.core.annotation.Immutable; -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 java.io.IOException; - -/** - * Common properties for all Azure resources. - */ -@Immutable -public class AzureResourceBase extends ProxyResource { - /* - * 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 AzureResourceBase class. - */ - public AzureResourceBase() { - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the AzureResourceBase object itself. - */ - AzureResourceBase withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceBase 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 AzureResourceBase. - */ - public static AzureResourceBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceBase deserializedAzureResourceBase = new AzureResourceBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureResourceBase.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureResourceBase.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureResourceBase.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureResourceBase.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceBase; - }); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java index 0f1aaba75e3c..8c11df536a4e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Deployment dependency information. */ -@Fluent +@Immutable public final class BasicDependency implements JsonSerializable { /* * The ID of the dependency. @@ -34,7 +34,7 @@ public final class BasicDependency implements JsonSerializable /** * Creates an instance of BasicDependency class. */ - public BasicDependency() { + private BasicDependency() { } /** @@ -46,17 +46,6 @@ public String id() { return this.id; } - /** - * Set the id property: The ID of the dependency. - * - * @param id the id value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withId(String id) { - this.id = id; - return this; - } - /** * Get the resourceType property: The dependency resource type. * @@ -66,17 +55,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the resourceType property: The dependency resource type. - * - * @param resourceType the resourceType value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the resourceName property: The dependency resource name. * @@ -86,17 +64,6 @@ public String resourceName() { return this.resourceName; } - /** - * Set the resourceName property: The dependency resource name. - * - * @param resourceName the resourceName value to set. - * @return the BasicDependency object itself. - */ - public BasicDependency withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeAttributes.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeAttributes.java index a5499c815839..11de0ca8279d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeAttributes.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeAttributes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeBase.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeBase.java index 98f7f284dbb9..93754dec11bb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeBase.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeCategory.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeCategory.java index 130d26dde31c..87d79a2ac777 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeCategory.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeProperties.java index 883ea093a6ab..e4d164c093f9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeResourceListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeResourceListResult.java index 994d78f6dee6..1218120f02fd 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeResourceListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeResourceListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java index 023ba7104b83..a380810350d4 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,37 +9,43 @@ */ public enum ChangeType { /** - * Enum value Create. + * The resource does not exist in the current state but is present in the desired state. The resource will be + * created when the deployment is executed. */ CREATE("Create"), /** - * Enum value Delete. + * The resource exists in the current state and is missing from the desired state. The resource will be deleted when + * the deployment is executed. */ DELETE("Delete"), /** - * Enum value Ignore. + * The resource exists in the current state and is missing from the desired state. The resource will not be deployed + * or modified when the deployment is executed. */ IGNORE("Ignore"), /** - * Enum value Deploy. + * The resource exists in the current state and the desired state and will be redeployed when the deployment is + * executed. The properties of the resource may or may not change. */ DEPLOY("Deploy"), /** - * Enum value NoChange. + * The resource exists in the current state and the desired state and will be redeployed when the deployment is + * executed. The properties of the resource will not change. */ NO_CHANGE("NoChange"), /** - * Enum value Modify. + * The resource exists in the current state and the desired state and will be redeployed when the deployment is + * executed. The properties of the resource will change. */ MODIFY("Modify"), /** - * Enum value Unsupported. + * The resource is not supported by What-If. */ UNSUPPORTED("Unsupported"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/CheckZonePeersRequest.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/CheckZonePeersRequest.java index d4e855d1a2dc..0fa2d3627292 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/CheckZonePeersRequest.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/CheckZonePeersRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundary.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundary.java index 3447268074d6..9f5b55f6664d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundary.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundary.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,17 @@ */ public final class DataBoundary extends ExpandableStringEnum { /** - * Static value NotDefined for DataBoundary. + * NotDefined. */ public static final DataBoundary NOT_DEFINED = fromString("NotDefined"); /** - * Static value Global for DataBoundary. + * Global. */ public static final DataBoundary GLOBAL = fromString("Global"); /** - * Static value EU for DataBoundary. + * EU. */ public static final DataBoundary EU = fromString("EU"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundaryProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundaryProperties.java index 11c6f1bb26f0..0a006f056c8c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundaryProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataBoundaryProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataEffect.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataEffect.java index 23b8cd5d72a2..0f06972b6222 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataEffect.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataEffect.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The data effect definition. */ -@Fluent +@Immutable public final class DataEffect implements JsonSerializable { /* * The data effect name. @@ -29,7 +29,7 @@ public final class DataEffect implements JsonSerializable { /** * Creates an instance of DataEffect class. */ - public DataEffect() { + private DataEffect() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: The data effect name. - * - * @param name the name value to set. - * @return the DataEffect object itself. - */ - public DataEffect withName(String name) { - this.name = name; - return this; - } - /** * Get the detailsSchema property: The data effect details schema. * @@ -61,17 +50,6 @@ public Object detailsSchema() { return this.detailsSchema; } - /** - * Set the detailsSchema property: The data effect details schema. - * - * @param detailsSchema the detailsSchema value to set. - * @return the DataEffect object itself. - */ - public DataEffect withDetailsSchema(Object detailsSchema) { - this.detailsSchema = detailsSchema; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataManifestCustomResourceFunctionDefinition.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataManifestCustomResourceFunctionDefinition.java index be4d2375da14..4b5e2fdc09c1 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataManifestCustomResourceFunctionDefinition.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DataManifestCustomResourceFunctionDefinition.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The custom resource function definition. */ -@Fluent +@Immutable public final class DataManifestCustomResourceFunctionDefinition implements JsonSerializable { /* @@ -29,8 +29,8 @@ public final class DataManifestCustomResourceFunctionDefinition private String fullyQualifiedResourceType; /* - * The top-level properties that can be selected on the function's output. eg - [ "name", "location" ] if - * vault().name and vault().location are supported + * The top-level properties that can be selected on the function's output. eg - [ \"name\", \"location\" ] if + * vault().name and vault().location are supported. */ private List defaultProperties; @@ -43,7 +43,7 @@ public final class DataManifestCustomResourceFunctionDefinition /** * Creates an instance of DataManifestCustomResourceFunctionDefinition class. */ - public DataManifestCustomResourceFunctionDefinition() { + private DataManifestCustomResourceFunctionDefinition() { } /** @@ -55,17 +55,6 @@ public String name() { return this.name; } - /** - * Set the name property: The function name as it will appear in the policy rule. eg - 'vault'. - * - * @param name the name value to set. - * @return the DataManifestCustomResourceFunctionDefinition object itself. - */ - public DataManifestCustomResourceFunctionDefinition withName(String name) { - this.name = name; - return this; - } - /** * Get the fullyQualifiedResourceType property: The fully qualified control plane resource type that this function * represents. eg - 'Microsoft.KeyVault/vaults'. @@ -76,22 +65,9 @@ public String fullyQualifiedResourceType() { return this.fullyQualifiedResourceType; } - /** - * Set the fullyQualifiedResourceType property: The fully qualified control plane resource type that this function - * represents. eg - 'Microsoft.KeyVault/vaults'. - * - * @param fullyQualifiedResourceType the fullyQualifiedResourceType value to set. - * @return the DataManifestCustomResourceFunctionDefinition object itself. - */ - public DataManifestCustomResourceFunctionDefinition - withFullyQualifiedResourceType(String fullyQualifiedResourceType) { - this.fullyQualifiedResourceType = fullyQualifiedResourceType; - return this; - } - /** * Get the defaultProperties property: The top-level properties that can be selected on the function's output. eg - - * [ "name", "location" ] if vault().name and vault().location are supported. + * [ \"name\", \"location\" ] if vault().name and vault().location are supported. * * @return the defaultProperties value. */ @@ -99,18 +75,6 @@ public List defaultProperties() { return this.defaultProperties; } - /** - * Set the defaultProperties property: The top-level properties that can be selected on the function's output. eg - - * [ "name", "location" ] if vault().name and vault().location are supported. - * - * @param defaultProperties the defaultProperties value to set. - * @return the DataManifestCustomResourceFunctionDefinition object itself. - */ - public DataManifestCustomResourceFunctionDefinition withDefaultProperties(List defaultProperties) { - this.defaultProperties = defaultProperties; - return this; - } - /** * Get the allowCustomProperties property: A value indicating whether the custom properties within the property bag * are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). @@ -121,18 +85,6 @@ public Boolean allowCustomProperties() { return this.allowCustomProperties; } - /** - * Set the allowCustomProperties property: A value indicating whether the custom properties within the property bag - * are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). - * - * @param allowCustomProperties the allowCustomProperties value to set. - * @return the DataManifestCustomResourceFunctionDefinition object itself. - */ - public DataManifestCustomResourceFunctionDefinition withAllowCustomProperties(Boolean allowCustomProperties) { - this.allowCustomProperties = allowCustomProperties; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java index b87c6aa3169f..4e68bc93af1a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DefaultName.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DefaultName.java index 1011f2c01a40..584962c3d957 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DefaultName.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DefaultName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,7 +12,7 @@ */ public final class DefaultName extends ExpandableStringEnum { /** - * Static value default for DefaultName. + * default. */ public static final DefaultName DEFAULT = fromString("default"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettings.java index 5e6e1b65f5a2..60076072fb24 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettings.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettingsMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettingsMode.java index 17b25c8b6314..2d306396e3f6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettingsMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenySettingsMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,17 @@ */ public final class DenySettingsMode extends ExpandableStringEnum { /** - * Static value denyDelete for DenySettingsMode. + * Authorized users are able to read and modify the resources, but cannot delete. */ public static final DenySettingsMode DENY_DELETE = fromString("denyDelete"); /** - * Static value denyWriteAndDelete for DenySettingsMode. + * Authorized users can read from a resource, but cannot modify or delete it. */ public static final DenySettingsMode DENY_WRITE_AND_DELETE = fromString("denyWriteAndDelete"); /** - * Static value none for DenySettingsMode. + * No denyAssignments have been applied. */ public static final DenySettingsMode NONE = fromString("none"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenyStatusMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenyStatusMode.java index 1c7d79ae8fb3..f73bf7db9c0b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenyStatusMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DenyStatusMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,32 +12,32 @@ */ public final class DenyStatusMode extends ExpandableStringEnum { /** - * Static value denyDelete for DenyStatusMode. + * Authorized users are able to read and modify the resources, but cannot delete. */ public static final DenyStatusMode DENY_DELETE = fromString("denyDelete"); /** - * Static value notSupported for DenyStatusMode. + * Resource type does not support denyAssignments. */ public static final DenyStatusMode NOT_SUPPORTED = fromString("notSupported"); /** - * Static value inapplicable for DenyStatusMode. + * denyAssignments are not supported on resources outside the scope of the deployment stack. */ public static final DenyStatusMode INAPPLICABLE = fromString("inapplicable"); /** - * Static value denyWriteAndDelete for DenyStatusMode. + * Authorized users can only read from a resource, but cannot modify or delete it. */ public static final DenyStatusMode DENY_WRITE_AND_DELETE = fromString("denyWriteAndDelete"); /** - * Static value removedBySystem for DenyStatusMode. + * Deny assignment has been removed by Azure due to a resource management change (management group move, etc.). */ public static final DenyStatusMode REMOVED_BY_SYSTEM = fromString("removedBySystem"); /** - * Static value none for DenyStatusMode. + * No denyAssignments have been applied. */ public static final DenyStatusMode NONE = fromString("none"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java index af737928a23a..c1e067dc3f0e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Dependency.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Deployment dependency information. */ -@Fluent +@Immutable public final class Dependency implements JsonSerializable { /* * The list of dependencies. @@ -40,7 +40,7 @@ public final class Dependency implements JsonSerializable { /** * Creates an instance of Dependency class. */ - public Dependency() { + private Dependency() { } /** @@ -52,17 +52,6 @@ public List dependsOn() { return this.dependsOn; } - /** - * Set the dependsOn property: The list of dependencies. - * - * @param dependsOn the dependsOn value to set. - * @return the Dependency object itself. - */ - public Dependency withDependsOn(List dependsOn) { - this.dependsOn = dependsOn; - return this; - } - /** * Get the id property: The ID of the dependency. * @@ -72,17 +61,6 @@ public String id() { return this.id; } - /** - * Set the id property: The ID of the dependency. - * - * @param id the id value to set. - * @return the Dependency object itself. - */ - public Dependency withId(String id) { - this.id = id; - return this; - } - /** * Get the resourceType property: The dependency resource type. * @@ -92,17 +70,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the resourceType property: The dependency resource type. - * - * @param resourceType the resourceType value to set. - * @return the Dependency object itself. - */ - public Dependency withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the resourceName property: The dependency resource name. * @@ -112,17 +79,6 @@ public String resourceName() { return this.resourceName; } - /** - * Set the resourceName property: The dependency resource name. - * - * @param resourceName the resourceName value to set. - * @return the Dependency object itself. - */ - public Dependency withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentDiagnosticsDefinition.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentDiagnosticsDefinition.java index ce949f1038a0..f44c05e71dba 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentDiagnosticsDefinition.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentDiagnosticsDefinition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -45,7 +45,7 @@ public final class DeploymentDiagnosticsDefinition implements JsonSerializable { /** - * Static value None for DeploymentIdentityType. + * None. */ public static final DeploymentIdentityType NONE = fromString("None"); /** - * Static value UserAssigned for DeploymentIdentityType. + * UserAssigned. */ public static final DeploymentIdentityType USER_ASSIGNED = fromString("UserAssigned"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java index a699f11feae2..004e0c1ceda7 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public enum DeploymentMode { /** - * Enum value Incremental. + * Incremental. */ INCREMENTAL("Incremental"), /** - * Enum value Complete. + * Complete. */ COMPLETE("Complete"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java index 9b32b08361f6..c45d2fa11d04 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -73,7 +73,7 @@ public final class DeploymentOperationProperties implements JsonSerializable { /** - * Static value creating for DeploymentStackProvisioningState. + * The deployment stack is currently being created. */ public static final DeploymentStackProvisioningState CREATING = fromString("creating"); /** - * Static value validating for DeploymentStackProvisioningState. + * The deployment stack is currently being validated. */ public static final DeploymentStackProvisioningState VALIDATING = fromString("validating"); /** - * Static value waiting for DeploymentStackProvisioningState. + * The deployment stack is currently waiting. */ public static final DeploymentStackProvisioningState WAITING = fromString("waiting"); /** - * Static value deploying for DeploymentStackProvisioningState. + * The deployment stack is currently deploying. */ public static final DeploymentStackProvisioningState DEPLOYING = fromString("deploying"); /** - * Static value canceling for DeploymentStackProvisioningState. + * The deployment stack is being cancelled. */ public static final DeploymentStackProvisioningState CANCELING = fromString("canceling"); /** - * Static value updatingDenyAssignments for DeploymentStackProvisioningState. + * The deployment stack is updating deny assignments. */ public static final DeploymentStackProvisioningState UPDATING_DENY_ASSIGNMENTS = fromString("updatingDenyAssignments"); /** - * Static value deletingResources for DeploymentStackProvisioningState. + * The deployment stack is deleting resources. */ public static final DeploymentStackProvisioningState DELETING_RESOURCES = fromString("deletingResources"); /** - * Static value succeeded for DeploymentStackProvisioningState. + * The deployment stack completed successfully. */ public static final DeploymentStackProvisioningState SUCCEEDED = fromString("succeeded"); /** - * Static value failed for DeploymentStackProvisioningState. + * The deployment stack has failed. */ public static final DeploymentStackProvisioningState FAILED = fromString("failed"); /** - * Static value canceled for DeploymentStackProvisioningState. + * The deployment stack has been cancelled. */ public static final DeploymentStackProvisioningState CANCELED = fromString("canceled"); /** - * Static value deleting for DeploymentStackProvisioningState. + * The deployment stack is being deleted. */ public static final DeploymentStackProvisioningState DELETING = fromString("deleting"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackValidateProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackValidateProperties.java index 32979d3cd3b6..65e54c88e47e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackValidateProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackValidateProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The Deployment stack validation result details. */ -@Fluent +@Immutable public final class DeploymentStackValidateProperties implements JsonSerializable { /* * Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. @@ -61,7 +61,7 @@ public final class DeploymentStackValidateProperties implements JsonSerializable /** * Creates an instance of DeploymentStackValidateProperties class. */ - public DeploymentStackValidateProperties() { + private DeploymentStackValidateProperties() { } /** @@ -74,18 +74,6 @@ public ActionOnUnmanage actionOnUnmanage() { return this.actionOnUnmanage; } - /** - * Set the actionOnUnmanage property: Defines the behavior of resources that are no longer managed after the - * Deployment stack is updated or deleted. - * - * @param actionOnUnmanage the actionOnUnmanage value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withActionOnUnmanage(ActionOnUnmanage actionOnUnmanage) { - this.actionOnUnmanage = actionOnUnmanage; - return this; - } - /** * Get the correlationId property: The correlation id of the Deployment stack validate operation. It is in GUID * format and is used for tracing. @@ -96,18 +84,6 @@ public String correlationId() { return this.correlationId; } - /** - * Set the correlationId property: The correlation id of the Deployment stack validate operation. It is in GUID - * format and is used for tracing. - * - * @param correlationId the correlationId value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; - } - /** * Get the denySettings property: The Deployment stack deny settings. * @@ -117,17 +93,6 @@ public DenySettings denySettings() { return this.denySettings; } - /** - * Set the denySettings property: The Deployment stack deny settings. - * - * @param denySettings the denySettings value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withDenySettings(DenySettings denySettings) { - this.denySettings = denySettings; - return this; - } - /** * Get the deploymentScope property: The Deployment stack deployment scope. * @@ -137,17 +102,6 @@ public String deploymentScope() { return this.deploymentScope; } - /** - * Set the deploymentScope property: The Deployment stack deployment scope. - * - * @param deploymentScope the deploymentScope value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withDeploymentScope(String deploymentScope) { - this.deploymentScope = deploymentScope; - return this; - } - /** * Get the description property: The Deployment stack validation description. * @@ -157,17 +111,6 @@ public String description() { return this.description; } - /** - * Set the description property: The Deployment stack validation description. - * - * @param description the description value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withDescription(String description) { - this.description = description; - return this; - } - /** * Get the parameters property: Deployment parameters. * @@ -177,17 +120,6 @@ public Map parameters() { return this.parameters; } - /** - * Set the parameters property: Deployment parameters. - * - * @param parameters the parameters value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withParameters(Map parameters) { - this.parameters = parameters; - return this; - } - /** * Get the templateLink property: The URI of the template. * @@ -197,17 +129,6 @@ public DeploymentStacksTemplateLink templateLink() { return this.templateLink; } - /** - * Set the templateLink property: The URI of the template. - * - * @param templateLink the templateLink value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withTemplateLink(DeploymentStacksTemplateLink templateLink) { - this.templateLink = templateLink; - return this; - } - /** * Get the validatedResources property: The array of resources that were validated. * @@ -217,17 +138,6 @@ public List validatedResources() { return this.validatedResources; } - /** - * Set the validatedResources property: The array of resources that were validated. - * - * @param validatedResources the validatedResources value to set. - * @return the DeploymentStackValidateProperties object itself. - */ - public DeploymentStackValidateProperties withValidatedResources(List validatedResources) { - this.validatedResources = validatedResources; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDebugSetting.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDebugSetting.java index b72657329e31..ad19af95db0d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDebugSetting.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDebugSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDeleteDetachEnum.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDeleteDetachEnum.java index 4e9319644aa9..305d39762879 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDeleteDetachEnum.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDeleteDetachEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -8,17 +8,16 @@ import java.util.Collection; /** - * Specifies an action for a newly unmanaged resource. Delete will attempt to delete the resource from Azure. Detach - * will leave the resource in it's current state. + * Specifies whether to delete or detach a resource from the deployment stack. */ public final class DeploymentStacksDeleteDetachEnum extends ExpandableStringEnum { /** - * Static value delete for DeploymentStacksDeleteDetachEnum. + * Delete the resource from Azure. */ public static final DeploymentStacksDeleteDetachEnum DELETE = fromString("delete"); /** - * Static value detach for DeploymentStacksDeleteDetachEnum. + * Keep the resource in Azure. */ public static final DeploymentStacksDeleteDetachEnum DETACH = fromString("detach"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksParametersLink.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksParametersLink.java index 607d3d4b1165..91cf79ea54d5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksParametersLink.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksParametersLink.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksTemplateLink.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksTemplateLink.java index 1b30e1a26da5..82a425a340b6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksTemplateLink.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksTemplateLink.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java index 7b966a16783a..cc6ad069685c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java index fec1258072f7..2ed0a92277ee 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java index 9949e288c9fb..71e8dc6f71b0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/EnforcementMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/EnforcementMode.java index 096167fdfd88..e54665562f1f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/EnforcementMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/EnforcementMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,18 @@ */ public final class EnforcementMode extends ExpandableStringEnum { /** - * Static value Default for EnforcementMode. + * The policy effect is enforced during resource creation or update. */ public static final EnforcementMode DEFAULT = fromString("Default"); /** - * Static value DoNotEnforce for EnforcementMode. + * The policy effect is not enforced during resource creation or update. */ public static final EnforcementMode DO_NOT_ENFORCE = fromString("DoNotEnforce"); /** - * Static value Enroll for EnforcementMode. + * The policy effect is not enforced during resource creation or update until the resource or scope of the resource + * is enrolled to the assignment instance. Enrollment occurs upon deployment of the policy enrollment resource. */ public static final EnforcementMode ENROLL = fromString("Enroll"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ErrorAdditionalInfo.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ErrorAdditionalInfo.java index a4f1b8dc017f..6d2ab44cb9b9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ErrorAdditionalInfo.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ErrorAdditionalInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -29,7 +29,7 @@ public final class ErrorAdditionalInfo implements JsonSerializable { /** - * Static value Json for ExportTemplateOutputFormat. + * Json. */ public static final ExportTemplateOutputFormat JSON = fromString("Json"); /** - * Static value Bicep for ExportTemplateOutputFormat. + * Bicep. */ public static final ExportTemplateOutputFormat BICEP = fromString("Bicep"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java index cdadd4e65753..c2693e3c3896 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptions.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptions.java index 118aa381ff08..25458daabc9b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptions.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptionsScopeType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptionsScopeType.java index 3659035bda39..37e6bd12f59b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptionsScopeType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptionsScopeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -13,17 +13,17 @@ public final class ExpressionEvaluationOptionsScopeType extends ExpandableStringEnum { /** - * Static value NotSpecified for ExpressionEvaluationOptionsScopeType. + * NotSpecified. */ public static final ExpressionEvaluationOptionsScopeType NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value Outer for ExpressionEvaluationOptionsScopeType. + * Outer. */ public static final ExpressionEvaluationOptionsScopeType OUTER = fromString("Outer"); /** - * Static value Inner for ExpressionEvaluationOptionsScopeType. + * Inner. */ public static final ExpressionEvaluationOptionsScopeType INNER = fromString("Inner"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocation.java index 622683b6fd4a..451e74f51329 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocationType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocationType.java index 807d004fed8f..3b739beff514 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocationType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,7 +12,7 @@ */ public final class ExtendedLocationType extends ExpandableStringEnum { /** - * Static value EdgeZone for ExtendedLocationType. + * EdgeZone. */ public static final ExtendedLocationType EDGE_ZONE = fromString("EdgeZone"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtensionConfigPropertyType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtensionConfigPropertyType.java index 180fb5f83df8..d92c94c32395 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtensionConfigPropertyType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExtensionConfigPropertyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,37 +12,37 @@ */ public final class ExtensionConfigPropertyType extends ExpandableStringEnum { /** - * Static value String for ExtensionConfigPropertyType. + * Property type representing a string value. */ public static final ExtensionConfigPropertyType STRING = fromString("String"); /** - * Static value Int for ExtensionConfigPropertyType. + * Property type representing an integer value. */ public static final ExtensionConfigPropertyType INT = fromString("Int"); /** - * Static value Bool for ExtensionConfigPropertyType. + * Property type representing a boolean value. */ public static final ExtensionConfigPropertyType BOOL = fromString("Bool"); /** - * Static value Array for ExtensionConfigPropertyType. + * Property type representing an array value. */ public static final ExtensionConfigPropertyType ARRAY = fromString("Array"); /** - * Static value Object for ExtensionConfigPropertyType. + * Property type representing an object value. */ public static final ExtensionConfigPropertyType OBJECT = fromString("Object"); /** - * Static value SecureString for ExtensionConfigPropertyType. + * Property type representing a secure string value. */ public static final ExtensionConfigPropertyType SECURE_STRING = fromString("SecureString"); /** - * Static value SecureObject for ExtensionConfigPropertyType. + * Property type representing a secure object value. */ public static final ExtensionConfigPropertyType SECURE_OBJECT = fromString("SecureObject"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEndpointResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEndpointResult.java index 0310f5a8a797..ed214bc5e89e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEndpointResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEndpointResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class ExternalEndpointResult extends ExpandableStringEnum { /** - * Static value Succeeded for ExternalEndpointResult. + * The external endpoint succeeded. */ public static final ExternalEndpointResult SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for ExternalEndpointResult. + * The external endpoint failed. */ public static final ExternalEndpointResult FAILED = fromString("Failed"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointInvocationResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointInvocationResult.java index 2edf6232bc3e..7babb5537c46 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointInvocationResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointInvocationResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The external evaluation endpoint invocation results. */ -@Fluent +@Immutable public final class ExternalEvaluationEndpointInvocationResult implements JsonSerializable { /* @@ -30,6 +30,11 @@ public final class ExternalEvaluationEndpointInvocationResult */ private ExternalEndpointResult result; + /* + * The external evaluation endpoint kind. + */ + private String endpointKind; + /* * The status message with additional details about the invocation result. */ @@ -46,6 +51,22 @@ public final class ExternalEvaluationEndpointInvocationResult */ private Object claims; + /* + * The effective outcome of the policy evaluation based on both the policy effect and evaluation result. Possible + * values are Unknown, Allow, Audit, Deny, Error. + */ + private PolicyAction policyAction; + + /* + * The evaluation details returned by the policy evaluation engine. + */ + private Object policyEvaluationDetails; + + /* + * The endpoint specific metadata. + */ + private Object additionalInfo; + /* * The expiration of the results. */ @@ -54,7 +75,7 @@ public final class ExternalEvaluationEndpointInvocationResult /** * Creates an instance of ExternalEvaluationEndpointInvocationResult class. */ - public ExternalEvaluationEndpointInvocationResult() { + private ExternalEvaluationEndpointInvocationResult() { } /** @@ -66,17 +87,6 @@ public PolicyLogInfo policyInfo() { return this.policyInfo; } - /** - * Set the policyInfo property: The details of the policy requiring the external endpoint invocation. - * - * @param policyInfo the policyInfo value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. - */ - public ExternalEvaluationEndpointInvocationResult withPolicyInfo(PolicyLogInfo policyInfo) { - this.policyInfo = policyInfo; - return this; - } - /** * Get the result property: The result of the external endpoint. Possible values are Succeeded and Failed. * @@ -87,14 +97,12 @@ public ExternalEndpointResult result() { } /** - * Set the result property: The result of the external endpoint. Possible values are Succeeded and Failed. + * Get the endpointKind property: The external evaluation endpoint kind. * - * @param result the result value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. + * @return the endpointKind value. */ - public ExternalEvaluationEndpointInvocationResult withResult(ExternalEndpointResult result) { - this.result = result; - return this; + public String endpointKind() { + return this.endpointKind; } /** @@ -106,17 +114,6 @@ public String message() { return this.message; } - /** - * Set the message property: The status message with additional details about the invocation result. - * - * @param message the message value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. - */ - public ExternalEvaluationEndpointInvocationResult withMessage(String message) { - this.message = message; - return this; - } - /** * Get the retryAfter property: The date and time after which a failed endpoint invocation can be retried. * @@ -126,17 +123,6 @@ public OffsetDateTime retryAfter() { return this.retryAfter; } - /** - * Set the retryAfter property: The date and time after which a failed endpoint invocation can be retried. - * - * @param retryAfter the retryAfter value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. - */ - public ExternalEvaluationEndpointInvocationResult withRetryAfter(OffsetDateTime retryAfter) { - this.retryAfter = retryAfter; - return this; - } - /** * Get the claims property: The set of claims that will be attached to the policy token as an attestation for the * result of the endpoint invocation. @@ -148,35 +134,40 @@ public Object claims() { } /** - * Set the claims property: The set of claims that will be attached to the policy token as an attestation for the - * result of the endpoint invocation. + * Get the policyAction property: The effective outcome of the policy evaluation based on both the policy effect and + * evaluation result. Possible values are Unknown, Allow, Audit, Deny, Error. * - * @param claims the claims value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. + * @return the policyAction value. */ - public ExternalEvaluationEndpointInvocationResult withClaims(Object claims) { - this.claims = claims; - return this; + public PolicyAction policyAction() { + return this.policyAction; } /** - * Get the expiration property: The expiration of the results. + * Get the policyEvaluationDetails property: The evaluation details returned by the policy evaluation engine. * - * @return the expiration value. + * @return the policyEvaluationDetails value. */ - public OffsetDateTime expiration() { - return this.expiration; + public Object policyEvaluationDetails() { + return this.policyEvaluationDetails; } /** - * Set the expiration property: The expiration of the results. + * Get the additionalInfo property: The endpoint specific metadata. * - * @param expiration the expiration value to set. - * @return the ExternalEvaluationEndpointInvocationResult object itself. + * @return the additionalInfo value. */ - public ExternalEvaluationEndpointInvocationResult withExpiration(OffsetDateTime expiration) { - this.expiration = expiration; - return this; + public Object additionalInfo() { + return this.additionalInfo; + } + + /** + * Get the expiration property: The expiration of the results. + * + * @return the expiration value. + */ + public OffsetDateTime expiration() { + return this.expiration; } /** @@ -198,12 +189,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("policyInfo", this.policyInfo); jsonWriter.writeStringField("result", this.result == null ? null : this.result.toString()); + jsonWriter.writeStringField("endpointKind", this.endpointKind); jsonWriter.writeStringField("message", this.message); jsonWriter.writeStringField("retryAfter", this.retryAfter == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.retryAfter)); if (this.claims != null) { jsonWriter.writeUntypedField("claims", this.claims); } + jsonWriter.writeStringField("policyAction", this.policyAction == null ? null : this.policyAction.toString()); + if (this.policyEvaluationDetails != null) { + jsonWriter.writeUntypedField("policyEvaluationDetails", this.policyEvaluationDetails); + } + if (this.additionalInfo != null) { + jsonWriter.writeUntypedField("additionalInfo", this.additionalInfo); + } jsonWriter.writeStringField("expiration", this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); return jsonWriter.writeEndObject(); @@ -230,6 +229,8 @@ public static ExternalEvaluationEndpointInvocationResult fromJson(JsonReader jso } else if ("result".equals(fieldName)) { deserializedExternalEvaluationEndpointInvocationResult.result = ExternalEndpointResult.fromString(reader.getString()); + } else if ("endpointKind".equals(fieldName)) { + deserializedExternalEvaluationEndpointInvocationResult.endpointKind = reader.getString(); } else if ("message".equals(fieldName)) { deserializedExternalEvaluationEndpointInvocationResult.message = reader.getString(); } else if ("retryAfter".equals(fieldName)) { @@ -237,6 +238,14 @@ public static ExternalEvaluationEndpointInvocationResult fromJson(JsonReader jso .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("claims".equals(fieldName)) { deserializedExternalEvaluationEndpointInvocationResult.claims = reader.readUntyped(); + } else if ("policyAction".equals(fieldName)) { + deserializedExternalEvaluationEndpointInvocationResult.policyAction + = PolicyAction.fromString(reader.getString()); + } else if ("policyEvaluationDetails".equals(fieldName)) { + deserializedExternalEvaluationEndpointInvocationResult.policyEvaluationDetails + = reader.readUntyped(); + } else if ("additionalInfo".equals(fieldName)) { + deserializedExternalEvaluationEndpointInvocationResult.additionalInfo = reader.readUntyped(); } else if ("expiration".equals(fieldName)) { deserializedExternalEvaluationEndpointInvocationResult.expiration = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointSettings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointSettings.java index 8533cf80182c..575ade96dd7d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointSettings.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEnforcementSettings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEnforcementSettings.java index c994a5782e47..09798dc43282 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEnforcementSettings.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEnforcementSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java index 01d985b8e009..21db8728a937 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureOperationsListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java index 1d4f2b834b5c..c093363af05b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/FeatureProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java index 53375b28b9f2..2e827848c8e5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * HTTP message. */ -@Fluent +@Immutable public final class HttpMessage implements JsonSerializable { /* * HTTP message content. @@ -24,7 +24,7 @@ public final class HttpMessage implements JsonSerializable { /** * Creates an instance of HttpMessage class. */ - public HttpMessage() { + private HttpMessage() { } /** @@ -36,17 +36,6 @@ public Object content() { return this.content; } - /** - * Set the content property: HTTP message content. - * - * @param content the content value to set. - * @return the HttpMessage object itself. - */ - public HttpMessage withContent(Object content) { - this.content = content; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java index 867944d34536..ad55b9ca6991 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Identity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java index 5808634dfd65..445ec4fdb576 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java index 0e19a2ff350b..934dd5d5580a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java index 20a2ecffd359..6ad1dc7731b1 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Level.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Level.java index b67176ab18eb..23ca73585853 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Level.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Level.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,17 @@ */ public final class Level extends ExpandableStringEnum { /** - * Static value Warning for Level. + * Warning. */ public static final Level WARNING = fromString("Warning"); /** - * Static value Info for Level. + * Info. */ public static final Level INFO = fromString("Info"); /** - * Static value Error for Level. + * Error. */ public static final Level ERROR = fromString("Error"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationMetadata.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationMetadata.java index ca31eab5f1cc..5ee9ec16a774 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationMetadata.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationMetadata.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Location metadata information. */ -@Fluent +@Immutable public final class LocationMetadata implements JsonSerializable { /* * The type of the region. @@ -65,7 +65,7 @@ public final class LocationMetadata implements JsonSerializable pairedRegion() { return this.pairedRegion; } - /** - * Set the pairedRegion property: The regions paired to this region. - * - * @param pairedRegion the pairedRegion value to set. - * @return the LocationMetadata object itself. - */ - public LocationMetadata withPairedRegion(List pairedRegion) { - this.pairedRegion = pairedRegion; - return this; - } - /** * Get the homeLocation property: The home location of an edge zone. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationType.java index e31554351423..d48c5b2f2a0a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LocationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,12 +9,12 @@ */ public enum LocationType { /** - * Enum value Region. + * Region. */ REGION("Region"), /** - * Enum value EdgeZone. + * EdgeZone. */ EDGE_ZONE("EdgeZone"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java index 2057c590155a..e819e7dc3cbf 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/LockLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedByTenant.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedByTenant.java index 20a0f058292c..6adcd142fc9e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedByTenant.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedByTenant.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -24,7 +24,7 @@ public final class ManagedByTenant implements JsonSerializable /** * Creates an instance of ManagedByTenant class. */ - public ManagedByTenant() { + private ManagedByTenant() { } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedResourceReference.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedResourceReference.java index 920f65684532..b0972ffaaab5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedResourceReference.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagedResourceReference.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,7 +13,7 @@ /** * The managed resource model. */ -@Fluent +@Immutable public final class ManagedResourceReference extends ResourceReference { /* * Current management state of the resource in the deployment stack. @@ -26,14 +26,14 @@ public final class ManagedResourceReference extends ResourceReference { private DenyStatusMode denyStatus; /* - * The resourceId of a resource managed by the deployment stack. + * The ARM Resource ID of a resource managed by the deployment stack. */ private String id; /** * Creates an instance of ManagedResourceReference class. */ - public ManagedResourceReference() { + private ManagedResourceReference() { } /** @@ -45,17 +45,6 @@ public ResourceStatusMode status() { return this.status; } - /** - * Set the status property: Current management state of the resource in the deployment stack. - * - * @param status the status value to set. - * @return the ManagedResourceReference object itself. - */ - public ManagedResourceReference withStatus(ResourceStatusMode status) { - this.status = status; - return this; - } - /** * Get the denyStatus property: denyAssignment settings applied to the resource. * @@ -66,18 +55,7 @@ public DenyStatusMode denyStatus() { } /** - * Set the denyStatus property: denyAssignment settings applied to the resource. - * - * @param denyStatus the denyStatus value to set. - * @return the ManagedResourceReference object itself. - */ - public ManagedResourceReference withDenyStatus(DenyStatusMode denyStatus) { - this.denyStatus = denyStatus; - return this; - } - - /** - * Get the id property: The resourceId of a resource managed by the deployment stack. + * Get the id property: The ARM Resource ID of a resource managed by the deployment stack. * * @return the id value. */ diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java index dc942d8c0ef2..5e62fed2a117 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java index 301791b928a8..d97a5b140ea7 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ManagementLockOwner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/NonComplianceMessage.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/NonComplianceMessage.java index c6cd29abd922..7377e7d7d134 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/NonComplianceMessage.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/NonComplianceMessage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java index 53efc5f82bcb..eb13ab7413cb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java index 7df55b249c7c..db511931a879 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Deployment on error behavior with additional details. */ -@Fluent +@Immutable public final class OnErrorDeploymentExtended implements JsonSerializable { /* * The state of the provisioning for the on error deployment. @@ -34,7 +34,7 @@ public final class OnErrorDeploymentExtended implements JsonSerializable { /* - * Service provider: Microsoft.Resources + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Resource on which the operation is performed: Profile, endpoint, etc. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation type: Read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Description of the operation. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Service provider: Microsoft.Resources. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String provider() { } /** - * Set the provider property: Service provider: Microsoft.Resources. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ public String resource() { } /** - * Set the resource property: Resource on which the operation is performed: Profile, endpoint, etc. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type: Read, write, delete, etc. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ public String operation() { } /** - * Set the operation property: Operation type: Read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,17 +85,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * @@ -136,10 +99,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); return jsonWriter.writeEndObject(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java index 5124f432fcf2..f3c3b167ba7a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OperationListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; @@ -14,13 +14,13 @@ import java.util.List; /** - * Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get - * the next set of results. + * Result of the request to list Microsoft.Authorization operations. It contains a list of operations and a URL link to + * get the next set of results. */ @Fluent public final class OperationListResult implements JsonSerializable { /* - * List of Microsoft.Resources operations. + * List of Microsoft.Authorization operations. */ private List value; @@ -36,7 +36,7 @@ public OperationListResult() { } /** - * Get the value property: List of Microsoft.Resources operations. + * Get the value property: List of Microsoft.Authorization operations. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Set the value property: List of Microsoft.Resources operations. + * Set the value property: List of Microsoft.Authorization operations. * * @param value the value value to set. * @return the OperationListResult object itself. diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Origin.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Origin.java new file mode 100644 index 000000000000..4fe58a98b299 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideKind.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideKind.java index 3b3191c65342..63b34061177d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideKind.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class OverrideKind extends ExpandableStringEnum { /** - * Static value policyEffect for OverrideKind. + * It will override the policy effect type. */ public static final OverrideKind POLICY_EFFECT = fromString("policyEffect"); /** - * Static value definitionVersion for OverrideKind. + * It will override the definition version property value of the policy assignment. */ public static final OverrideKind DEFINITION_VERSION = fromString("definitionVersion"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideModel.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideModel.java index 5ecf5ef44897..763d4a148b1d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideModel.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/OverrideModel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PairedRegion.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PairedRegion.java index 9a4bd8d29a57..64b60a4493a0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PairedRegion.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PairedRegion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -35,7 +35,7 @@ public final class PairedRegion implements JsonSerializable { /** * Creates an instance of PairedRegion class. */ - public PairedRegion() { + private PairedRegion() { } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValue.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValue.java index 5a51d689d49f..093ee6862d06 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValue.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValueMetadata.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValueMetadata.java index dfff6d183217..0ecdfbca6056 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValueMetadata.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValueMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterType.java index ae80ed6899e5..bb8ac5e84cc2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,37 +12,37 @@ */ public final class ParameterType extends ExpandableStringEnum { /** - * Static value String for ParameterType. + * The string parameter type. */ public static final ParameterType STRING = fromString("String"); /** - * Static value Array for ParameterType. + * The array parameter type. */ public static final ParameterType ARRAY = fromString("Array"); /** - * Static value Object for ParameterType. + * The object parameter type. */ public static final ParameterType OBJECT = fromString("Object"); /** - * Static value Boolean for ParameterType. + * The boolean parameter type. */ public static final ParameterType BOOLEAN = fromString("Boolean"); /** - * Static value Integer for ParameterType. + * The integer parameter type. */ public static final ParameterType INTEGER = fromString("Integer"); /** - * Static value Float for ParameterType. + * The float parameter type. */ public static final ParameterType FLOAT = fromString("Float"); /** - * Static value DateTime for ParameterType. + * The date-time parameter type. */ public static final ParameterType DATE_TIME = fromString("DateTime"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterValuesValue.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterValuesValue.java index 6f29b140ae63..c96b5dd8f32b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterValuesValue.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParameterValuesValue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java index 0cfd4c0abc90..eef8fda9ce89 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Peers.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Peers.java index 54f8e706e193..0a89c34dcb73 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Peers.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Peers.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -29,7 +29,7 @@ public final class Peers implements JsonSerializable { /** * Creates an instance of Peers class. */ - public Peers() { + private Peers() { } /** diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Permission.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Permission.java index 2bff4c7f0372..a6f634688185 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Permission.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Permission.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Role definition permissions. */ -@Fluent +@Immutable public final class Permission implements JsonSerializable { /* * Allowed actions. @@ -40,7 +40,7 @@ public final class Permission implements JsonSerializable { /** * Creates an instance of Permission class. */ - public Permission() { + private Permission() { } /** @@ -52,17 +52,6 @@ public List actions() { return this.actions; } - /** - * Set the actions property: Allowed actions. - * - * @param actions the actions value to set. - * @return the Permission object itself. - */ - public Permission withActions(List actions) { - this.actions = actions; - return this; - } - /** * Get the notActions property: Denied actions. * @@ -72,17 +61,6 @@ public List notActions() { return this.notActions; } - /** - * Set the notActions property: Denied actions. - * - * @param notActions the notActions value to set. - * @return the Permission object itself. - */ - public Permission withNotActions(List notActions) { - this.notActions = notActions; - return this; - } - /** * Get the dataActions property: Allowed Data actions. * @@ -92,17 +70,6 @@ public List dataActions() { return this.dataActions; } - /** - * Set the dataActions property: Allowed Data actions. - * - * @param dataActions the dataActions value to set. - * @return the Permission object itself. - */ - public Permission withDataActions(List dataActions) { - this.dataActions = dataActions; - return this; - } - /** * Get the notDataActions property: Denied Data actions. * @@ -112,17 +79,6 @@ public List notDataActions() { return this.notDataActions; } - /** - * Set the notDataActions property: Denied Data actions. - * - * @param notDataActions the notDataActions value to set. - * @return the Permission object itself. - */ - public Permission withNotDataActions(List notDataActions) { - this.notDataActions = notDataActions; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java index 77f0d824cecd..127eec5dc56d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Plan.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAction.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAction.java new file mode 100644 index 000000000000..3e13746881f6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAction.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The effective outcome of the policy evaluation based on both the policy effect and evaluation result. Possible values + * are Unknown, Allow, Audit, Deny, Error. + */ +public final class PolicyAction extends ExpandableStringEnum { + /** + * The effective outcome of policy evaluation is unknown. + */ + public static final PolicyAction UNKNOWN = fromString("Unknown"); + + /** + * The effective outcome of policy evaluation is to allow the request. + */ + public static final PolicyAction ALLOW = fromString("Allow"); + + /** + * The effective outcome of policy evaluation is to audit the request. + */ + public static final PolicyAction AUDIT = fromString("Audit"); + + /** + * The effective outcome of policy evaluation is to deny the request. + */ + public static final PolicyAction DENY = fromString("Deny"); + + /** + * The policy evaluation resulted in an error. + */ + public static final PolicyAction ERROR = fromString("Error"); + + /** + * Creates a new instance of PolicyAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PolicyAction() { + } + + /** + * Creates or finds a PolicyAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyAction. + */ + public static PolicyAction fromString(String name) { + return fromString(name, PolicyAction.class); + } + + /** + * Gets known PolicyAction values. + * + * @return known PolicyAction values. + */ + public static Collection values() { + return values(PolicyAction.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentUpdate.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentUpdate.java index 084b3d11f4eb..0d9261964ac7 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentUpdate.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -134,6 +134,30 @@ public PolicyAssignmentUpdate withOverrides(List overrides) { return this; } + /** + * Get the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @return the selfServeExemptionSettings value. + */ + public SelfServeExemptionSettings selfServeExemptionSettings() { + return this.innerProperties() == null ? null : this.innerProperties().selfServeExemptionSettings(); + } + + /** + * Set the selfServeExemptionSettings property: The self-serve exemption settings for the policy assignment. + * + * @param selfServeExemptionSettings the selfServeExemptionSettings value to set. + * @return the PolicyAssignmentUpdate object itself. + */ + public PolicyAssignmentUpdate + withSelfServeExemptionSettings(SelfServeExemptionSettings selfServeExemptionSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new PolicyAssignmentUpdateProperties(); + } + this.innerProperties().withSelfServeExemptionSettings(selfServeExemptionSettings); + return this; + } + /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionGroup.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionGroup.java index b7b1cffe968e..b8c81c6be60f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionGroup.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionGroup.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionReference.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionReference.java index 5928ae7c2d97..e1ceb1b6b0a3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionReference.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionListResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionListResult.java index 110f799b7f1c..2d2c2a66a347 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionListResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionUpdate.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionUpdate.java index b6512f956b1d..60d8e975ac53 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionUpdate.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyExemptionUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyLogInfo.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyLogInfo.java index 2be22da543d6..7990ead094ce 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyLogInfo.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyLogInfo.java @@ -1,21 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.List; /** * The policy log info. */ -@Fluent +@Immutable public final class PolicyLogInfo implements JsonSerializable { /* * The policy definition Id. @@ -37,31 +36,16 @@ public final class PolicyLogInfo implements JsonSerializable { */ private String policySetDefinitionName; - /* - * The policy set definition display name. - */ - private String policySetDefinitionDisplayName; - /* * The policy set definition version. */ private String policySetDefinitionVersion; - /* - * The policy set definition category. - */ - private String policySetDefinitionCategory; - /* * The policy definition name. */ private String policyDefinitionName; - /* - * The policy definition display name. - */ - private String policyDefinitionDisplayName; - /* * The policy definition version. */ @@ -72,11 +56,6 @@ public final class PolicyLogInfo implements JsonSerializable { */ private String policyDefinitionEffect; - /* - * An array of policy definition group names. - */ - private List policyDefinitionGroupNames; - /* * The policy assignment Id. */ @@ -87,11 +66,6 @@ public final class PolicyLogInfo implements JsonSerializable { */ private String policyAssignmentName; - /* - * The policy assignment display name. - */ - private String policyAssignmentDisplayName; - /* * The policy assignment version. */ @@ -102,30 +76,10 @@ public final class PolicyLogInfo implements JsonSerializable { */ private String policyAssignmentScope; - /* - * The resource location. - */ - private String resourceLocation; - - /* - * The management group ancestors. - */ - private String ancestors; - - /* - * The policy compliance reason code. - */ - private String complianceReasonCode; - - /* - * An array of policy exemption Ids. - */ - private List policyExemptionIds; - /** * Creates an instance of PolicyLogInfo class. */ - public PolicyLogInfo() { + private PolicyLogInfo() { } /** @@ -137,17 +91,6 @@ public String policyDefinitionId() { return this.policyDefinitionId; } - /** - * Set the policyDefinitionId property: The policy definition Id. - * - * @param policyDefinitionId the policyDefinitionId value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionId(String policyDefinitionId) { - this.policyDefinitionId = policyDefinitionId; - return this; - } - /** * Get the policySetDefinitionId property: The policy set definition Id. * @@ -157,17 +100,6 @@ public String policySetDefinitionId() { return this.policySetDefinitionId; } - /** - * Set the policySetDefinitionId property: The policy set definition Id. - * - * @param policySetDefinitionId the policySetDefinitionId value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicySetDefinitionId(String policySetDefinitionId) { - this.policySetDefinitionId = policySetDefinitionId; - return this; - } - /** * Get the policyDefinitionReferenceId property: The policy definition instance Id inside a policy set. * @@ -177,17 +109,6 @@ public String policyDefinitionReferenceId() { return this.policyDefinitionReferenceId; } - /** - * Set the policyDefinitionReferenceId property: The policy definition instance Id inside a policy set. - * - * @param policyDefinitionReferenceId the policyDefinitionReferenceId value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionReferenceId(String policyDefinitionReferenceId) { - this.policyDefinitionReferenceId = policyDefinitionReferenceId; - return this; - } - /** * Get the policySetDefinitionName property: The policy set definition name. * @@ -197,37 +118,6 @@ public String policySetDefinitionName() { return this.policySetDefinitionName; } - /** - * Set the policySetDefinitionName property: The policy set definition name. - * - * @param policySetDefinitionName the policySetDefinitionName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicySetDefinitionName(String policySetDefinitionName) { - this.policySetDefinitionName = policySetDefinitionName; - return this; - } - - /** - * Get the policySetDefinitionDisplayName property: The policy set definition display name. - * - * @return the policySetDefinitionDisplayName value. - */ - public String policySetDefinitionDisplayName() { - return this.policySetDefinitionDisplayName; - } - - /** - * Set the policySetDefinitionDisplayName property: The policy set definition display name. - * - * @param policySetDefinitionDisplayName the policySetDefinitionDisplayName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicySetDefinitionDisplayName(String policySetDefinitionDisplayName) { - this.policySetDefinitionDisplayName = policySetDefinitionDisplayName; - return this; - } - /** * Get the policySetDefinitionVersion property: The policy set definition version. * @@ -237,37 +127,6 @@ public String policySetDefinitionVersion() { return this.policySetDefinitionVersion; } - /** - * Set the policySetDefinitionVersion property: The policy set definition version. - * - * @param policySetDefinitionVersion the policySetDefinitionVersion value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicySetDefinitionVersion(String policySetDefinitionVersion) { - this.policySetDefinitionVersion = policySetDefinitionVersion; - return this; - } - - /** - * Get the policySetDefinitionCategory property: The policy set definition category. - * - * @return the policySetDefinitionCategory value. - */ - public String policySetDefinitionCategory() { - return this.policySetDefinitionCategory; - } - - /** - * Set the policySetDefinitionCategory property: The policy set definition category. - * - * @param policySetDefinitionCategory the policySetDefinitionCategory value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicySetDefinitionCategory(String policySetDefinitionCategory) { - this.policySetDefinitionCategory = policySetDefinitionCategory; - return this; - } - /** * Get the policyDefinitionName property: The policy definition name. * @@ -277,37 +136,6 @@ public String policyDefinitionName() { return this.policyDefinitionName; } - /** - * Set the policyDefinitionName property: The policy definition name. - * - * @param policyDefinitionName the policyDefinitionName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionName(String policyDefinitionName) { - this.policyDefinitionName = policyDefinitionName; - return this; - } - - /** - * Get the policyDefinitionDisplayName property: The policy definition display name. - * - * @return the policyDefinitionDisplayName value. - */ - public String policyDefinitionDisplayName() { - return this.policyDefinitionDisplayName; - } - - /** - * Set the policyDefinitionDisplayName property: The policy definition display name. - * - * @param policyDefinitionDisplayName the policyDefinitionDisplayName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionDisplayName(String policyDefinitionDisplayName) { - this.policyDefinitionDisplayName = policyDefinitionDisplayName; - return this; - } - /** * Get the policyDefinitionVersion property: The policy definition version. * @@ -317,17 +145,6 @@ public String policyDefinitionVersion() { return this.policyDefinitionVersion; } - /** - * Set the policyDefinitionVersion property: The policy definition version. - * - * @param policyDefinitionVersion the policyDefinitionVersion value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionVersion(String policyDefinitionVersion) { - this.policyDefinitionVersion = policyDefinitionVersion; - return this; - } - /** * Get the policyDefinitionEffect property: The policy definition action. * @@ -337,37 +154,6 @@ public String policyDefinitionEffect() { return this.policyDefinitionEffect; } - /** - * Set the policyDefinitionEffect property: The policy definition action. - * - * @param policyDefinitionEffect the policyDefinitionEffect value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionEffect(String policyDefinitionEffect) { - this.policyDefinitionEffect = policyDefinitionEffect; - return this; - } - - /** - * Get the policyDefinitionGroupNames property: An array of policy definition group names. - * - * @return the policyDefinitionGroupNames value. - */ - public List policyDefinitionGroupNames() { - return this.policyDefinitionGroupNames; - } - - /** - * Set the policyDefinitionGroupNames property: An array of policy definition group names. - * - * @param policyDefinitionGroupNames the policyDefinitionGroupNames value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyDefinitionGroupNames(List policyDefinitionGroupNames) { - this.policyDefinitionGroupNames = policyDefinitionGroupNames; - return this; - } - /** * Get the policyAssignmentId property: The policy assignment Id. * @@ -377,17 +163,6 @@ public String policyAssignmentId() { return this.policyAssignmentId; } - /** - * Set the policyAssignmentId property: The policy assignment Id. - * - * @param policyAssignmentId the policyAssignmentId value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyAssignmentId(String policyAssignmentId) { - this.policyAssignmentId = policyAssignmentId; - return this; - } - /** * Get the policyAssignmentName property: The policy assignment name. * @@ -397,37 +172,6 @@ public String policyAssignmentName() { return this.policyAssignmentName; } - /** - * Set the policyAssignmentName property: The policy assignment name. - * - * @param policyAssignmentName the policyAssignmentName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyAssignmentName(String policyAssignmentName) { - this.policyAssignmentName = policyAssignmentName; - return this; - } - - /** - * Get the policyAssignmentDisplayName property: The policy assignment display name. - * - * @return the policyAssignmentDisplayName value. - */ - public String policyAssignmentDisplayName() { - return this.policyAssignmentDisplayName; - } - - /** - * Set the policyAssignmentDisplayName property: The policy assignment display name. - * - * @param policyAssignmentDisplayName the policyAssignmentDisplayName value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyAssignmentDisplayName(String policyAssignmentDisplayName) { - this.policyAssignmentDisplayName = policyAssignmentDisplayName; - return this; - } - /** * Get the policyAssignmentVersion property: The policy assignment version. * @@ -437,17 +181,6 @@ public String policyAssignmentVersion() { return this.policyAssignmentVersion; } - /** - * Set the policyAssignmentVersion property: The policy assignment version. - * - * @param policyAssignmentVersion the policyAssignmentVersion value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyAssignmentVersion(String policyAssignmentVersion) { - this.policyAssignmentVersion = policyAssignmentVersion; - return this; - } - /** * Get the policyAssignmentScope property: The policy assignment scope. * @@ -457,97 +190,6 @@ public String policyAssignmentScope() { return this.policyAssignmentScope; } - /** - * Set the policyAssignmentScope property: The policy assignment scope. - * - * @param policyAssignmentScope the policyAssignmentScope value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyAssignmentScope(String policyAssignmentScope) { - this.policyAssignmentScope = policyAssignmentScope; - return this; - } - - /** - * Get the resourceLocation property: The resource location. - * - * @return the resourceLocation value. - */ - public String resourceLocation() { - return this.resourceLocation; - } - - /** - * Set the resourceLocation property: The resource location. - * - * @param resourceLocation the resourceLocation value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withResourceLocation(String resourceLocation) { - this.resourceLocation = resourceLocation; - return this; - } - - /** - * Get the ancestors property: The management group ancestors. - * - * @return the ancestors value. - */ - public String ancestors() { - return this.ancestors; - } - - /** - * Set the ancestors property: The management group ancestors. - * - * @param ancestors the ancestors value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withAncestors(String ancestors) { - this.ancestors = ancestors; - return this; - } - - /** - * Get the complianceReasonCode property: The policy compliance reason code. - * - * @return the complianceReasonCode value. - */ - public String complianceReasonCode() { - return this.complianceReasonCode; - } - - /** - * Set the complianceReasonCode property: The policy compliance reason code. - * - * @param complianceReasonCode the complianceReasonCode value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withComplianceReasonCode(String complianceReasonCode) { - this.complianceReasonCode = complianceReasonCode; - return this; - } - - /** - * Get the policyExemptionIds property: An array of policy exemption Ids. - * - * @return the policyExemptionIds value. - */ - public List policyExemptionIds() { - return this.policyExemptionIds; - } - - /** - * Set the policyExemptionIds property: An array of policy exemption Ids. - * - * @param policyExemptionIds the policyExemptionIds value to set. - * @return the PolicyLogInfo object itself. - */ - public PolicyLogInfo withPolicyExemptionIds(List policyExemptionIds) { - this.policyExemptionIds = policyExemptionIds; - return this; - } - /** * Validates the instance. * @@ -566,25 +208,14 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("policySetDefinitionId", this.policySetDefinitionId); jsonWriter.writeStringField("policyDefinitionReferenceId", this.policyDefinitionReferenceId); jsonWriter.writeStringField("policySetDefinitionName", this.policySetDefinitionName); - jsonWriter.writeStringField("policySetDefinitionDisplayName", this.policySetDefinitionDisplayName); jsonWriter.writeStringField("policySetDefinitionVersion", this.policySetDefinitionVersion); - jsonWriter.writeStringField("policySetDefinitionCategory", this.policySetDefinitionCategory); jsonWriter.writeStringField("policyDefinitionName", this.policyDefinitionName); - jsonWriter.writeStringField("policyDefinitionDisplayName", this.policyDefinitionDisplayName); jsonWriter.writeStringField("policyDefinitionVersion", this.policyDefinitionVersion); jsonWriter.writeStringField("policyDefinitionEffect", this.policyDefinitionEffect); - jsonWriter.writeArrayField("policyDefinitionGroupNames", this.policyDefinitionGroupNames, - (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("policyAssignmentId", this.policyAssignmentId); jsonWriter.writeStringField("policyAssignmentName", this.policyAssignmentName); - jsonWriter.writeStringField("policyAssignmentDisplayName", this.policyAssignmentDisplayName); jsonWriter.writeStringField("policyAssignmentVersion", this.policyAssignmentVersion); jsonWriter.writeStringField("policyAssignmentScope", this.policyAssignmentScope); - jsonWriter.writeStringField("resourceLocation", this.resourceLocation); - jsonWriter.writeStringField("ancestors", this.ancestors); - jsonWriter.writeStringField("complianceReasonCode", this.complianceReasonCode); - jsonWriter.writeArrayField("policyExemptionIds", this.policyExemptionIds, - (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -611,42 +242,22 @@ public static PolicyLogInfo fromJson(JsonReader jsonReader) throws IOException { deserializedPolicyLogInfo.policyDefinitionReferenceId = reader.getString(); } else if ("policySetDefinitionName".equals(fieldName)) { deserializedPolicyLogInfo.policySetDefinitionName = reader.getString(); - } else if ("policySetDefinitionDisplayName".equals(fieldName)) { - deserializedPolicyLogInfo.policySetDefinitionDisplayName = reader.getString(); } else if ("policySetDefinitionVersion".equals(fieldName)) { deserializedPolicyLogInfo.policySetDefinitionVersion = reader.getString(); - } else if ("policySetDefinitionCategory".equals(fieldName)) { - deserializedPolicyLogInfo.policySetDefinitionCategory = reader.getString(); } else if ("policyDefinitionName".equals(fieldName)) { deserializedPolicyLogInfo.policyDefinitionName = reader.getString(); - } else if ("policyDefinitionDisplayName".equals(fieldName)) { - deserializedPolicyLogInfo.policyDefinitionDisplayName = reader.getString(); } else if ("policyDefinitionVersion".equals(fieldName)) { deserializedPolicyLogInfo.policyDefinitionVersion = reader.getString(); } else if ("policyDefinitionEffect".equals(fieldName)) { deserializedPolicyLogInfo.policyDefinitionEffect = reader.getString(); - } else if ("policyDefinitionGroupNames".equals(fieldName)) { - List policyDefinitionGroupNames = reader.readArray(reader1 -> reader1.getString()); - deserializedPolicyLogInfo.policyDefinitionGroupNames = policyDefinitionGroupNames; } else if ("policyAssignmentId".equals(fieldName)) { deserializedPolicyLogInfo.policyAssignmentId = reader.getString(); } else if ("policyAssignmentName".equals(fieldName)) { deserializedPolicyLogInfo.policyAssignmentName = reader.getString(); - } else if ("policyAssignmentDisplayName".equals(fieldName)) { - deserializedPolicyLogInfo.policyAssignmentDisplayName = reader.getString(); } else if ("policyAssignmentVersion".equals(fieldName)) { deserializedPolicyLogInfo.policyAssignmentVersion = reader.getString(); } else if ("policyAssignmentScope".equals(fieldName)) { deserializedPolicyLogInfo.policyAssignmentScope = reader.getString(); - } else if ("resourceLocation".equals(fieldName)) { - deserializedPolicyLogInfo.resourceLocation = reader.getString(); - } else if ("ancestors".equals(fieldName)) { - deserializedPolicyLogInfo.ancestors = reader.getString(); - } else if ("complianceReasonCode".equals(fieldName)) { - deserializedPolicyLogInfo.complianceReasonCode = reader.getString(); - } else if ("policyExemptionIds".equals(fieldName)) { - List policyExemptionIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPolicyLogInfo.policyExemptionIds = policyExemptionIds; } else { reader.skipChildren(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenEvaluatedRequestDetails.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenEvaluatedRequestDetails.java new file mode 100644 index 000000000000..5915667e44de --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenEvaluatedRequestDetails.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The policy token evaluated request details. + */ +@Immutable +public final class PolicyTokenEvaluatedRequestDetails implements JsonSerializable { + /* + * The request URI of the resource operation that is targeted by the issued token. + */ + private String uri; + + /* + * The resource Id of the resource operation that is targeted by the issued token. + */ + private String resourceId; + + /* + * The api-version of the resource operation that is targeted by the issued token. + */ + private String apiVersion; + + /* + * The authorization action of the resource operation that is targeted by the issued token. + */ + private String authorizationAction; + + /* + * The http method of the resource operation that is targeted by the issued token. + */ + private String httpMethod; + + /* + * The hashed payload of the resource operation that is targeted by the issued token. + */ + private String contentHash; + + /** + * Creates an instance of PolicyTokenEvaluatedRequestDetails class. + */ + private PolicyTokenEvaluatedRequestDetails() { + } + + /** + * Get the uri property: The request URI of the resource operation that is targeted by the issued token. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the resourceId property: The resource Id of the resource operation that is targeted by the issued token. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the apiVersion property: The api-version of the resource operation that is targeted by the issued token. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Get the authorizationAction property: The authorization action of the resource operation that is targeted by the + * issued token. + * + * @return the authorizationAction value. + */ + public String authorizationAction() { + return this.authorizationAction; + } + + /** + * Get the httpMethod property: The http method of the resource operation that is targeted by the issued token. + * + * @return the httpMethod value. + */ + public String httpMethod() { + return this.httpMethod; + } + + /** + * Get the contentHash property: The hashed payload of the resource operation that is targeted by the issued token. + * + * @return the contentHash value. + */ + public String contentHash() { + return this.contentHash; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property uri in model PolicyTokenEvaluatedRequestDetails")); + } + if (resourceId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceId in model PolicyTokenEvaluatedRequestDetails")); + } + if (apiVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property apiVersion in model PolicyTokenEvaluatedRequestDetails")); + } + if (authorizationAction() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authorizationAction in model PolicyTokenEvaluatedRequestDetails")); + } + if (httpMethod() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property httpMethod in model PolicyTokenEvaluatedRequestDetails")); + } + if (contentHash() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property contentHash in model PolicyTokenEvaluatedRequestDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyTokenEvaluatedRequestDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("uri", this.uri); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("apiVersion", this.apiVersion); + jsonWriter.writeStringField("authorizationAction", this.authorizationAction); + jsonWriter.writeStringField("httpMethod", this.httpMethod); + jsonWriter.writeStringField("contentHash", this.contentHash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicyTokenEvaluatedRequestDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicyTokenEvaluatedRequestDetails 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 PolicyTokenEvaluatedRequestDetails. + */ + public static PolicyTokenEvaluatedRequestDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicyTokenEvaluatedRequestDetails deserializedPolicyTokenEvaluatedRequestDetails + = new PolicyTokenEvaluatedRequestDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("uri".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.uri = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.resourceId = reader.getString(); + } else if ("apiVersion".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.apiVersion = reader.getString(); + } else if ("authorizationAction".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.authorizationAction = reader.getString(); + } else if ("httpMethod".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.httpMethod = reader.getString(); + } else if ("contentHash".equals(fieldName)) { + deserializedPolicyTokenEvaluatedRequestDetails.contentHash = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicyTokenEvaluatedRequestDetails; + }); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenOperation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenOperation.java index e839142345b2..12507078e72c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenOperation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenRequest.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenRequest.java index 2c9be82bbafd..0d838bdd5b75 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenRequest.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenResult.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenResult.java index 712a111ba9be..d153a212e913 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenResult.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class PolicyTokenResult extends ExpandableStringEnum { /** - * Static value Succeeded for PolicyTokenResult. + * The token acquisition succeeded. */ public static final PolicyTokenResult SUCCEEDED = fromString("Succeeded"); /** - * Static value Failed for PolicyTokenResult. + * The token acquisition failed. */ public static final PolicyTokenResult FAILED = fromString("Failed"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java index 695fef4b6089..60e64fb8e90e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,22 +12,22 @@ */ public final class PolicyType extends ExpandableStringEnum { /** - * Static value NotSpecified for PolicyType. + * The not specified policy definition type. */ public static final PolicyType NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value BuiltIn for PolicyType. + * The built in policy definition type. */ public static final PolicyType BUILT_IN = fromString("BuiltIn"); /** - * Static value Custom for PolicyType. + * The custom policy definition type. */ public static final PolicyType CUSTOM = fromString("Custom"); /** - * Static value Static for PolicyType. + * The static policy definition type. */ public static final PolicyType STATIC = fromString("Static"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java index 4039bbd6743d..9dc36cc5cf43 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,27 +9,30 @@ */ public enum PropertyChangeType { /** - * Enum value Create. + * The property does not exist in the current state but is present in the desired state. The property will be + * created when the deployment is executed. */ CREATE("Create"), /** - * Enum value Delete. + * The property exists in the current state and is missing from the desired state. It will be deleted when the + * deployment is executed. */ DELETE("Delete"), /** - * Enum value Modify. + * The property exists in both current and desired state and is different. The value of the property will change + * when the deployment is executed. */ MODIFY("Modify"), /** - * Enum value Array. + * The property is an array and contains nested changes. */ ARRAY("Array"), /** - * Enum value NoEffect. + * The property will not be set or updated. */ NO_EFFECT("NoEffect"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java index 9234ef0e7af9..5278cac61b2e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,22 +12,22 @@ */ public final class ProviderAuthorizationConsentState extends ExpandableStringEnum { /** - * Static value NotSpecified for ProviderAuthorizationConsentState. + * NotSpecified. */ public static final ProviderAuthorizationConsentState NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value Required for ProviderAuthorizationConsentState. + * Required. */ public static final ProviderAuthorizationConsentState REQUIRED = fromString("Required"); /** - * Static value NotRequired for ProviderAuthorizationConsentState. + * NotRequired. */ public static final ProviderAuthorizationConsentState NOT_REQUIRED = fromString("NotRequired"); /** - * Static value Consented for ProviderAuthorizationConsentState. + * Consented. */ public static final ProviderAuthorizationConsentState CONSENTED = fromString("Consented"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderConsentDefinition.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderConsentDefinition.java index e7127c6ea51d..bcf3a51cd29c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderConsentDefinition.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderConsentDefinition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java index 39b5bc17b40f..69261d1c665c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The provider extended location. */ -@Fluent +@Immutable public final class ProviderExtendedLocation implements JsonSerializable { /* * The azure location. @@ -35,7 +35,7 @@ public final class ProviderExtendedLocation implements JsonSerializable extendedLocations() { return this.extendedLocations; } - /** - * Set the extendedLocations property: The extended locations for the azure location. - * - * @param extendedLocations the extendedLocations value to set. - * @return the ProviderExtendedLocation object itself. - */ - public ProviderExtendedLocation withExtendedLocations(List extendedLocations) { - this.extendedLocations = extendedLocations; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderPermission.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderPermission.java index 20fcfdd15806..1f9279c24d57 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderPermission.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProviderPermission.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The provider permission. */ -@Fluent +@Immutable public final class ProviderPermission implements JsonSerializable { /* * The application id. @@ -39,7 +39,7 @@ public final class ProviderPermission implements JsonSerializable { /* * The resource type. @@ -71,7 +71,7 @@ public final class ProviderResourceType implements JsonSerializable locations() { return this.locations; } - /** - * Set the locations property: The collection of locations where this resource type can be created. - * - * @param locations the locations value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withLocations(List locations) { - this.locations = locations; - return this; - } - /** * Get the locationMappings property: The location mappings that are supported by this resource type. * @@ -123,17 +101,6 @@ public List locationMappings() { return this.locationMappings; } - /** - * Set the locationMappings property: The location mappings that are supported by this resource type. - * - * @param locationMappings the locationMappings value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withLocationMappings(List locationMappings) { - this.locationMappings = locationMappings; - return this; - } - /** * Get the aliases property: The aliases that are supported by this resource type. * @@ -143,17 +110,6 @@ public List aliases() { return this.aliases; } - /** - * Set the aliases property: The aliases that are supported by this resource type. - * - * @param aliases the aliases value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withAliases(List aliases) { - this.aliases = aliases; - return this; - } - /** * Get the apiVersions property: The API version. * @@ -163,17 +119,6 @@ public List apiVersions() { return this.apiVersions; } - /** - * Set the apiVersions property: The API version. - * - * @param apiVersions the apiVersions value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withApiVersions(List apiVersions) { - this.apiVersions = apiVersions; - return this; - } - /** * Get the defaultApiVersion property: The default API version. * @@ -192,17 +137,6 @@ public List zoneMappings() { return this.zoneMappings; } - /** - * Set the zoneMappings property: The zoneMappings property. - * - * @param zoneMappings the zoneMappings value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withZoneMappings(List zoneMappings) { - this.zoneMappings = zoneMappings; - return this; - } - /** * Get the apiProfiles property: The API profiles for the resource provider. * @@ -221,17 +155,6 @@ public String capabilities() { return this.capabilities; } - /** - * Set the capabilities property: The additional capabilities offered by this resource type. - * - * @param capabilities the capabilities value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withCapabilities(String capabilities) { - this.capabilities = capabilities; - return this; - } - /** * Get the properties property: The properties. * @@ -241,17 +164,6 @@ public Map properties() { return this.properties; } - /** - * Set the properties property: The properties. - * - * @param properties the properties value to set. - * @return the ProviderResourceType object itself. - */ - public ProviderResourceType withProperties(Map properties) { - this.properties = properties; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java index d34a627d73fe..1c483558cbaf 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,52 +9,52 @@ */ public enum ProvisioningOperation { /** - * Enum value NotSpecified. + * The provisioning operation is not specified. */ NOT_SPECIFIED("NotSpecified"), /** - * Enum value Create. + * The provisioning operation is create. */ CREATE("Create"), /** - * Enum value Delete. + * The provisioning operation is delete. */ DELETE("Delete"), /** - * Enum value Waiting. + * The provisioning operation is waiting. */ WAITING("Waiting"), /** - * Enum value AzureAsyncOperationWaiting. + * The provisioning operation is waiting Azure async operation. */ AZURE_ASYNC_OPERATION_WAITING("AzureAsyncOperationWaiting"), /** - * Enum value ResourceCacheWaiting. + * The provisioning operation is waiting for resource cache. */ RESOURCE_CACHE_WAITING("ResourceCacheWaiting"), /** - * Enum value Action. + * The provisioning operation is action. */ ACTION("Action"), /** - * Enum value Read. + * The provisioning operation is read. */ READ("Read"), /** - * Enum value EvaluateDeploymentOutput. + * The provisioning operation is evaluate output. */ EVALUATE_DEPLOYMENT_OUTPUT("EvaluateDeploymentOutput"), /** - * Enum value DeploymentCleanup. + * The provisioning operation is cleanup. This operation is part of the 'complete' mode deployment. */ DEPLOYMENT_CLEANUP("DeploymentCleanup"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java index 1f4f6e82c1f6..52554717c33b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,62 +12,62 @@ */ public final class ProvisioningState extends ExpandableStringEnum { /** - * Static value NotSpecified for ProvisioningState. + * NotSpecified. */ public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); /** - * Static value Accepted for ProvisioningState. + * Accepted. */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); /** - * Static value Running for ProvisioningState. + * Running. */ public static final ProvisioningState RUNNING = fromString("Running"); /** - * Static value Ready for ProvisioningState. + * Ready. */ public static final ProvisioningState READY = fromString("Ready"); /** - * Static value Creating for ProvisioningState. + * Creating. */ public static final ProvisioningState CREATING = fromString("Creating"); /** - * Static value Created for ProvisioningState. + * Created. */ public static final ProvisioningState CREATED = fromString("Created"); /** - * Static value Deleting for ProvisioningState. + * Deleting. */ public static final ProvisioningState DELETING = fromString("Deleting"); /** - * Static value Deleted for ProvisioningState. + * Deleted. */ public static final ProvisioningState DELETED = fromString("Deleted"); /** - * Static value Canceled for ProvisioningState. + * Canceled. */ public static final ProvisioningState CANCELED = fromString("Canceled"); /** - * Static value Failed for ProvisioningState. + * Failed. */ public static final ProvisioningState FAILED = fromString("Failed"); /** - * Static value Succeeded for ProvisioningState. + * Succeeded. */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Updating for ProvisioningState. + * Updating. */ public static final ProvisioningState UPDATING = fromString("Updating"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionCategory.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionCategory.java index e46a3814fadf..cc248ba9fbd2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionCategory.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,17 @@ */ public final class RegionCategory extends ExpandableStringEnum { /** - * Static value Recommended for RegionCategory. + * Recommended. */ public static final RegionCategory RECOMMENDED = fromString("Recommended"); /** - * Static value Extended for RegionCategory. + * Extended. */ public static final RegionCategory EXTENDED = fromString("Extended"); /** - * Static value Other for RegionCategory. + * Other. */ public static final RegionCategory OTHER = fromString("Other"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionType.java index 51bb6d8ba496..63af95b0652a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RegionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class RegionType extends ExpandableStringEnum { /** - * Static value Physical for RegionType. + * Physical. */ public static final RegionType PHYSICAL = fromString("Physical"); /** - * Static value Logical for RegionType. + * Logical. */ public static final RegionType LOGICAL = fromString("Logical"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceChangeType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceChangeType.java index 0a2a6297cda2..98b4d76a66f3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceChangeType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceChangeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java index 91bd0f385b23..6818d3d50326 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java index 6f7a5212eb7e..3942773f0885 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java index c7f94fe1b09f..15e9e2bbeafe 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,22 +9,22 @@ */ public enum ResourceIdentityType { /** - * Enum value SystemAssigned. + * SystemAssigned. */ SYSTEM_ASSIGNED("SystemAssigned"), /** - * Enum value UserAssigned. + * UserAssigned. */ USER_ASSIGNED("UserAssigned"), /** - * Enum value SystemAssigned, UserAssigned. + * SystemAssigned, UserAssigned. */ SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), /** - * Enum value None. + * None. */ NONE("None"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java index bc821bf00b1e..641835b68437 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java index d680bb57c813..3a801878d703 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,12 +12,12 @@ */ public final class ResourceNameStatus extends ExpandableStringEnum { /** - * Static value Allowed for ResourceNameStatus. + * Allowed. */ public static final ResourceNameStatus ALLOWED = fromString("Allowed"); /** - * Static value Reserved for ResourceNameStatus. + * Reserved. */ public static final ResourceNameStatus RESERVED = fromString("Reserved"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcePropertyChangeType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcePropertyChangeType.java index d6cced8b76a1..1093d41f06a0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcePropertyChangeType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcePropertyChangeType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java index f6c45cf75813..05bb6bb28a5d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; import com.azure.core.annotation.Immutable; @@ -16,6 +15,7 @@ */ @Immutable public class ResourceReference implements JsonSerializable { + /* * The fully qualified Azure resource ID. */ @@ -44,7 +44,7 @@ public class ResourceReference implements JsonSerializable { /** * Creates an instance of ResourceReference class. */ - public ResourceReference() { + protected ResourceReference() { } /** @@ -126,7 +126,6 @@ public static ResourceReference fromJson(JsonReader jsonReader) throws IOExcepti while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { deserializedResourceReference.id = reader.getString(); } else if ("extension".equals(fieldName)) { @@ -141,7 +140,6 @@ public static ResourceReference fromJson(JsonReader jsonReader) throws IOExcepti reader.skipChildren(); } } - return deserializedResourceReference; }); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReferenceExtended.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReferenceExtended.java index e14356a8b7f9..cfa8fa3a8e07 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReferenceExtended.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceReferenceExtended.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -14,52 +15,40 @@ /** * The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error. */ -@Fluent -public final class ResourceReferenceExtended extends ResourceReference { +@Immutable +public final class ResourceReferenceExtended implements JsonSerializable { /* - * The error detail. + * The ARM Resource ID of a resource managed by the deployment stack. */ - private ManagementError error; + private String id; /* - * The resourceId of a resource managed by the deployment stack. + * The error detail. */ - private String id; + private ManagementError error; /** * Creates an instance of ResourceReferenceExtended class. */ - public ResourceReferenceExtended() { + private ResourceReferenceExtended() { } /** - * Get the error property: The error detail. + * Get the id property: The ARM Resource ID of a resource managed by the deployment stack. * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: The error detail. - * - * @param error the error value to set. - * @return the ResourceReferenceExtended object itself. + * @return the id value. */ - public ResourceReferenceExtended withError(ManagementError error) { - this.error = error; - return this; + public String id() { + return this.id; } /** - * Get the id property: The resourceId of a resource managed by the deployment stack. + * Get the error property: The error detail. * - * @return the id value. + * @return the error value. */ - @Override - public String id() { - return this.id; + public ManagementError error() { + return this.error; } /** @@ -67,7 +56,6 @@ public String id() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { } @@ -77,7 +65,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("error", this.error); return jsonWriter.writeEndObject(); } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceSelector.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceSelector.java index c3659917e0d6..eff82b5de502 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceSelector.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceSelector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceStatusMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceStatusMode.java index 9296088a19f1..2ed0ec394340 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceStatusMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceStatusMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,18 @@ */ public final class ResourceStatusMode extends ExpandableStringEnum { /** - * Static value managed for ResourceStatusMode. + * This resource is managed by the deployment stack. */ public static final ResourceStatusMode MANAGED = fromString("managed"); /** - * Static value removeDenyFailed for ResourceStatusMode. + * Unable to remove the deny assignment on resource. */ public static final ResourceStatusMode REMOVE_DENY_FAILED = fromString("removeDenyFailed"); /** - * Static value deleteFailed for ResourceStatusMode. + * Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be + * deleted manually. */ public static final ResourceStatusMode DELETE_FAILED = fromString("deleteFailed"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceTypeAliases.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceTypeAliases.java index 194ab8c5f4fb..2d137f0d2318 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceTypeAliases.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourceTypeAliases.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The resource type aliases definition. */ -@Fluent +@Immutable public final class ResourceTypeAliases implements JsonSerializable { /* * The resource type name. @@ -30,7 +30,7 @@ public final class ResourceTypeAliases implements JsonSerializable aliases() { return this.aliases; } - /** - * Set the aliases property: The aliases for property names. - * - * @param aliases the aliases value to set. - * @return the ResourceTypeAliases object itself. - */ - public ResourceTypeAliases withAliases(List aliases) { - this.aliases = aliases; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java index d635101ee83a..9bbb847905c0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RoleDefinition.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RoleDefinition.java index dcad3b31e124..5986179d01ff 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RoleDefinition.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/RoleDefinition.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Role definition properties. */ -@Fluent +@Immutable public final class RoleDefinition implements JsonSerializable { /* * The role definition ID. @@ -45,7 +45,7 @@ public final class RoleDefinition implements JsonSerializable { /** * Creates an instance of RoleDefinition class. */ - public RoleDefinition() { + private RoleDefinition() { } /** @@ -57,17 +57,6 @@ public String id() { return this.id; } - /** - * Set the id property: The role definition ID. - * - * @param id the id value to set. - * @return the RoleDefinition object itself. - */ - public RoleDefinition withId(String id) { - this.id = id; - return this; - } - /** * Get the name property: The role definition name. * @@ -77,17 +66,6 @@ public String name() { return this.name; } - /** - * Set the name property: The role definition name. - * - * @param name the name value to set. - * @return the RoleDefinition object itself. - */ - public RoleDefinition withName(String name) { - this.name = name; - return this; - } - /** * Get the isServiceRole property: If this is a service role. * @@ -97,17 +75,6 @@ public Boolean isServiceRole() { return this.isServiceRole; } - /** - * Set the isServiceRole property: If this is a service role. - * - * @param isServiceRole the isServiceRole value to set. - * @return the RoleDefinition object itself. - */ - public RoleDefinition withIsServiceRole(Boolean isServiceRole) { - this.isServiceRole = isServiceRole; - return this; - } - /** * Get the permissions property: Role definition permissions. * @@ -117,17 +84,6 @@ public List permissions() { return this.permissions; } - /** - * Set the permissions property: Role definition permissions. - * - * @param permissions the permissions value to set. - * @return the RoleDefinition object itself. - */ - public RoleDefinition withPermissions(List permissions) { - this.permissions = permissions; - return this; - } - /** * Get the scopes property: Role definition assignable scopes. * @@ -137,17 +93,6 @@ public List scopes() { return this.scopes; } - /** - * Set the scopes property: Role definition assignable scopes. - * - * @param scopes the scopes value to set. - * @return the RoleDefinition object itself. - */ - public RoleDefinition withScopes(List scopes) { - this.scopes = scopes; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java index c5c44d89a57e..48ad6a1015d3 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java index 3ad6d2932690..5e1563b2d40d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Selector.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Selector.java index 93cc522e0e86..a59db9be453c 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Selector.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Selector.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelectorKind.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelectorKind.java index 3a6779875265..78cebd978dcd 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelectorKind.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelectorKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,22 +12,22 @@ */ public final class SelectorKind extends ExpandableStringEnum { /** - * Static value resourceLocation for SelectorKind. + * The selector kind to filter policies by the resource location. */ public static final SelectorKind RESOURCE_LOCATION = fromString("resourceLocation"); /** - * Static value resourceType for SelectorKind. + * The selector kind to filter policies by the resource type. */ public static final SelectorKind RESOURCE_TYPE = fromString("resourceType"); /** - * Static value resourceWithoutLocation for SelectorKind. + * The selector kind to filter policies by the resource without location. */ public static final SelectorKind RESOURCE_WITHOUT_LOCATION = fromString("resourceWithoutLocation"); /** - * Static value policyDefinitionReferenceId for SelectorKind. + * The selector kind to filter policies by the policy definition reference ID. */ public static final SelectorKind POLICY_DEFINITION_REFERENCE_ID = fromString("policyDefinitionReferenceId"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelfServeExemptionSettings.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelfServeExemptionSettings.java new file mode 100644 index 000000000000..16db529f0322 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SelfServeExemptionSettings.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.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 self-serve exemption settings for a policy assignment. + */ +@Fluent +public final class SelfServeExemptionSettings implements JsonSerializable { + /* + * Indicates whether self-serve exemption is enabled. + */ + private Boolean enabled; + + /* + * The policy definition reference IDs for self-serve exemption. + */ + private List policyDefinitionReferenceIds; + + /** + * Creates an instance of SelfServeExemptionSettings class. + */ + public SelfServeExemptionSettings() { + } + + /** + * Get the enabled property: Indicates whether self-serve exemption is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether self-serve exemption is enabled. + * + * @param enabled the enabled value to set. + * @return the SelfServeExemptionSettings object itself. + */ + public SelfServeExemptionSettings withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the policyDefinitionReferenceIds property: The policy definition reference IDs for self-serve exemption. + * + * @return the policyDefinitionReferenceIds value. + */ + public List policyDefinitionReferenceIds() { + return this.policyDefinitionReferenceIds; + } + + /** + * Set the policyDefinitionReferenceIds property: The policy definition reference IDs for self-serve exemption. + * + * @param policyDefinitionReferenceIds the policyDefinitionReferenceIds value to set. + * @return the SelfServeExemptionSettings object itself. + */ + public SelfServeExemptionSettings withPolicyDefinitionReferenceIds(List policyDefinitionReferenceIds) { + this.policyDefinitionReferenceIds = policyDefinitionReferenceIds; + 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.writeBooleanField("enabled", this.enabled); + jsonWriter.writeArrayField("policyDefinitionReferenceIds", this.policyDefinitionReferenceIds, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SelfServeExemptionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SelfServeExemptionSettings 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 SelfServeExemptionSettings. + */ + public static SelfServeExemptionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SelfServeExemptionSettings deserializedSelfServeExemptionSettings = new SelfServeExemptionSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedSelfServeExemptionSettings.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("policyDefinitionReferenceIds".equals(fieldName)) { + List policyDefinitionReferenceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedSelfServeExemptionSettings.policyDefinitionReferenceIds = policyDefinitionReferenceIds; + } else { + reader.skipChildren(); + } + } + + return deserializedSelfServeExemptionSettings; + }); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java index 0054b66f2401..83dcb514b70a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Sku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java index 85495e7189b2..92fa33b9a83e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,17 +9,17 @@ */ public enum SpendingLimit { /** - * Enum value On. + * On. */ ON("On"), /** - * Enum value Off. + * Off. */ OFF("Off"), /** - * Enum value CurrentPeriodOff. + * CurrentPeriodOff. */ CURRENT_PERIOD_OFF("CurrentPeriodOff"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/StatusMessage.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/StatusMessage.java index 0f5497561f4c..1884ac335399 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/StatusMessage.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/StatusMessage.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.exception.ManagementError; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Operation status message object. */ -@Fluent +@Immutable public final class StatusMessage implements JsonSerializable { /* * Status of the deployment operation. @@ -30,7 +30,7 @@ public final class StatusMessage implements JsonSerializable { /** * Creates an instance of StatusMessage class. */ - public StatusMessage() { + private StatusMessage() { } /** @@ -42,17 +42,6 @@ public String status() { return this.status; } - /** - * Set the status property: Status of the deployment operation. - * - * @param status the status value to set. - * @return the StatusMessage object itself. - */ - public StatusMessage withStatus(String status) { - this.status = status; - return this; - } - /** * Get the error property: The error reported by the operation. * @@ -62,17 +51,6 @@ public ManagementError error() { return this.error; } - /** - * Set the error property: The error reported by the operation. - * - * @param error the error value to set. - * @return the StatusMessage object itself. - */ - public StatusMessage withError(ManagementError error) { - this.error = error; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationApprovalType.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationApprovalType.java index 440fdf0a44ca..8bda338da2e8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationApprovalType.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationApprovalType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationList.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationList.java index 939e9cf91a2d..8e90bbbb4dc6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationList.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationList.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationProperties.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationProperties.java index d1e72903fced..fb10c8dc3410 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationProperties.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationState.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationState.java index 8eff92828a99..8d608844cc88 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationState.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionFeatureRegistrationState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Generated code package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java index e02aa82ae58c..7c1ccad6ef85 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -35,7 +35,7 @@ public final class SubscriptionPolicies implements JsonSerializable { /* * Type of count. @@ -29,7 +29,7 @@ public final class TagCount implements JsonSerializable { /** * Creates an instance of TagCount class. */ - public TagCount() { + private TagCount() { } /** @@ -41,17 +41,6 @@ public String type() { return this.type; } - /** - * Set the type property: Type of count. - * - * @param type the type value to set. - * @return the TagCount object itself. - */ - public TagCount withType(String type) { - this.type = type; - return this; - } - /** * Get the value property: Value of count. * @@ -61,17 +50,6 @@ public Integer value() { return this.value; } - /** - * Set the value property: Value of count. - * - * @param value the value value to set. - * @return the TagCount object itself. - */ - public TagCount withValue(Integer value) { - this.value = value; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java index 4a3986987777..ce39233ea3d4 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/Tags.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java index d3f8593ecec2..ae4426d2e141 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,17 @@ */ public final class TagsPatchOperation extends ExpandableStringEnum { /** - * Static value Replace for TagsPatchOperation. + * The 'replace' option replaces the entire set of existing tags with a new set. */ public static final TagsPatchOperation REPLACE = fromString("Replace"); /** - * Static value Merge for TagsPatchOperation. + * The 'merge' option allows adding tags with new names and updating the values of tags with existing names. */ public static final TagsPatchOperation MERGE = fromString("Merge"); /** - * Static value Delete for TagsPatchOperation. + * The 'delete' option allows selectively deleting tags based on given names or name/value pairs. */ public static final TagsPatchOperation DELETE = fromString("Delete"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java index b6ef45406753..c61c3dbf0009 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java index 5d648f18f8ae..8f0b7f9d4c1d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Target resource. */ -@Fluent +@Immutable public final class TargetResource implements JsonSerializable { /* * The Azure resource ID of the resource. @@ -54,7 +54,7 @@ public final class TargetResource implements JsonSerializable { /** * Creates an instance of TargetResource class. */ - public TargetResource() { + private TargetResource() { } /** @@ -66,17 +66,6 @@ public String id() { return this.id; } - /** - * Set the id property: The Azure resource ID of the resource. - * - * @param id the id value to set. - * @return the TargetResource object itself. - */ - public TargetResource withId(String id) { - this.id = id; - return this; - } - /** * Get the resourceName property: The name of the resource. * @@ -86,17 +75,6 @@ public String resourceName() { return this.resourceName; } - /** - * Set the resourceName property: The name of the resource. - * - * @param resourceName the resourceName value to set. - * @return the TargetResource object itself. - */ - public TargetResource withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - /** * Get the resourceType property: The type of the resource. * @@ -106,17 +84,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the resourceType property: The type of the resource. - * - * @param resourceType the resourceType value to set. - * @return the TargetResource object itself. - */ - public TargetResource withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the extension property: The extension the resource was deployed with. * @@ -126,17 +93,6 @@ public DeploymentExtensionDefinition extension() { return this.extension; } - /** - * Set the extension property: The extension the resource was deployed with. - * - * @param extension the extension value to set. - * @return the TargetResource object itself. - */ - public TargetResource withExtension(DeploymentExtensionDefinition extension) { - this.extension = extension; - return this; - } - /** * Get the identifiers property: The extensible resource identifiers. * @@ -146,17 +102,6 @@ public Object identifiers() { return this.identifiers; } - /** - * Set the identifiers property: The extensible resource identifiers. - * - * @param identifiers the identifiers value to set. - * @return the TargetResource object itself. - */ - public TargetResource withIdentifiers(Object identifiers) { - this.identifiers = identifiers; - return this; - } - /** * Get the apiVersion property: The API version the resource was deployed with. * @@ -166,17 +111,6 @@ public String apiVersion() { return this.apiVersion; } - /** - * Set the apiVersion property: The API version the resource was deployed with. - * - * @param apiVersion the apiVersion value to set. - * @return the TargetResource object itself. - */ - public TargetResource withApiVersion(String apiVersion) { - this.apiVersion = apiVersion; - return this; - } - /** * Get the symbolicName property: The symbolic name of the resource as defined in the deployment template. * @@ -186,17 +120,6 @@ public String symbolicName() { return this.symbolicName; } - /** - * Set the symbolicName property: The symbolic name of the resource as defined in the deployment template. - * - * @param symbolicName the symbolicName value to set. - * @return the TargetResource object itself. - */ - public TargetResource withSymbolicName(String symbolicName) { - this.symbolicName = symbolicName; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java index 399ef6286632..f1c2a22d56fc 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantCategory.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantCategory.java index a60dbdaef4c5..1bd811c05b96 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantCategory.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/TenantCategory.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,17 +9,17 @@ */ public enum TenantCategory { /** - * Enum value Home. + * Home. */ HOME("Home"), /** - * Enum value ProjectedBy. + * ProjectedBy. */ PROJECTED_BY("ProjectedBy"), /** - * Enum value ManagedBy. + * ManagedBy. */ MANAGED_BY("ManagedBy"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionManagementGroupMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionManagementGroupMode.java index 99e4b9b08171..6ddfef403486 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionManagementGroupMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionManagementGroupMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * Defines values for UnmanageActionManagementGroupMode. + * Specifies an action for a newly unmanaged resource. */ public final class UnmanageActionManagementGroupMode extends ExpandableStringEnum { /** - * Static value delete for UnmanageActionManagementGroupMode. + * Delete the management groups from Azure. */ public static final UnmanageActionManagementGroupMode DELETE = fromString("delete"); /** - * Static value detach for UnmanageActionManagementGroupMode. + * Keep the management groups in Azure. */ public static final UnmanageActionManagementGroupMode DETACH = fromString("detach"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceGroupMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceGroupMode.java index a6f8a8a3bef1..aed6d801997a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceGroupMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceGroupMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * Defines values for UnmanageActionResourceGroupMode. + * Specifies an action for a newly unmanaged resource group. */ public final class UnmanageActionResourceGroupMode extends ExpandableStringEnum { /** - * Static value delete for UnmanageActionResourceGroupMode. + * Delete the resource groups from Azure. */ public static final UnmanageActionResourceGroupMode DELETE = fromString("delete"); /** - * Static value detach for UnmanageActionResourceGroupMode. + * Keep the resource groups in Azure. */ public static final UnmanageActionResourceGroupMode DETACH = fromString("detach"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceMode.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceMode.java index 7523a8e4dec9..3f1f2e45ec61 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceMode.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -8,16 +8,16 @@ import java.util.Collection; /** - * Defines values for UnmanageActionResourceMode. + * Specifies an action for a newly unmanaged resource. */ public final class UnmanageActionResourceMode extends ExpandableStringEnum { /** - * Static value delete for UnmanageActionResourceMode. + * Delete the resources from Azure. */ public static final UnmanageActionResourceMode DELETE = fromString("delete"); /** - * Static value detach for UnmanageActionResourceMode. + * Keep the resources in Azure. */ public static final UnmanageActionResourceMode DETACH = fromString("detach"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UserAssignedIdentity.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UserAssignedIdentity.java index b6028ce2622f..46b240e2a13f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UserAssignedIdentity.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ValidationLevel.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ValidationLevel.java index a9e313edfb9e..6233524fb35d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ValidationLevel.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ValidationLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -12,17 +12,19 @@ */ public final class ValidationLevel extends ExpandableStringEnum { /** - * Static value Template for ValidationLevel. + * Static analysis of the template is performed. */ public static final ValidationLevel TEMPLATE = fromString("Template"); /** - * Static value Provider for ValidationLevel. + * Static analysis of the template is performed and resource declarations are sent to resource providers for + * semantic validation. Validates that the caller has RBAC write permissions on each resource. */ public static final ValidationLevel PROVIDER = fromString("Provider"); /** - * Static value ProviderNoRbac for ValidationLevel. + * Static analysis of the template is performed and resource declarations are sent to resource providers for + * semantic validation. Skips validating that the caller has RBAC write permissions on each resource. */ public static final ValidationLevel PROVIDER_NO_RBAC = fromString("ProviderNoRbac"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java index 23db5557fae1..b1c4029af019 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,7 +16,7 @@ /** * Information about a single resource change predicted by What-If operation. */ -@Fluent +@Immutable public final class WhatIfChange implements JsonSerializable { /* * Resource ID @@ -72,7 +72,7 @@ public final class WhatIfChange implements JsonSerializable { /** * Creates an instance of WhatIfChange class. */ - public WhatIfChange() { + private WhatIfChange() { } /** @@ -84,17 +84,6 @@ public String resourceId() { return this.resourceId; } - /** - * Set the resourceId property: Resource ID. - * - * @param resourceId the resourceId value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - /** * Get the deploymentId property: The resource id of the Deployment responsible for this change. * @@ -104,17 +93,6 @@ public String deploymentId() { return this.deploymentId; } - /** - * Set the deploymentId property: The resource id of the Deployment responsible for this change. - * - * @param deploymentId the deploymentId value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withDeploymentId(String deploymentId) { - this.deploymentId = deploymentId; - return this; - } - /** * Get the symbolicName property: The symbolic name of the resource responsible for this change. * @@ -124,17 +102,6 @@ public String symbolicName() { return this.symbolicName; } - /** - * Set the symbolicName property: The symbolic name of the resource responsible for this change. - * - * @param symbolicName the symbolicName value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withSymbolicName(String symbolicName) { - this.symbolicName = symbolicName; - return this; - } - /** * Get the identifiers property: A subset of properties that uniquely identify a Bicep extensible resource because * it lacks a resource id like an Azure resource has. @@ -145,18 +112,6 @@ public Object identifiers() { return this.identifiers; } - /** - * Set the identifiers property: A subset of properties that uniquely identify a Bicep extensible resource because - * it lacks a resource id like an Azure resource has. - * - * @param identifiers the identifiers value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withIdentifiers(Object identifiers) { - this.identifiers = identifiers; - return this; - } - /** * Get the extension property: The extension the resource was deployed with. * @@ -166,17 +121,6 @@ public DeploymentExtensionDefinition extension() { return this.extension; } - /** - * Set the extension property: The extension the resource was deployed with. - * - * @param extension the extension value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withExtension(DeploymentExtensionDefinition extension) { - this.extension = extension; - return this; - } - /** * Get the changeType property: Type of change that will be made to the resource when the deployment is executed. * @@ -186,17 +130,6 @@ public ChangeType changeType() { return this.changeType; } - /** - * Set the changeType property: Type of change that will be made to the resource when the deployment is executed. - * - * @param changeType the changeType value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withChangeType(ChangeType changeType) { - this.changeType = changeType; - return this; - } - /** * Get the unsupportedReason property: The explanation about why the resource is unsupported by What-If. * @@ -206,17 +139,6 @@ public String unsupportedReason() { return this.unsupportedReason; } - /** - * Set the unsupportedReason property: The explanation about why the resource is unsupported by What-If. - * - * @param unsupportedReason the unsupportedReason value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withUnsupportedReason(String unsupportedReason) { - this.unsupportedReason = unsupportedReason; - return this; - } - /** * Get the before property: The snapshot of the resource before the deployment is executed. * @@ -226,17 +148,6 @@ public Object before() { return this.before; } - /** - * Set the before property: The snapshot of the resource before the deployment is executed. - * - * @param before the before value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withBefore(Object before) { - this.before = before; - return this; - } - /** * Get the after property: The predicted snapshot of the resource after the deployment is executed. * @@ -246,17 +157,6 @@ public Object after() { return this.after; } - /** - * Set the after property: The predicted snapshot of the resource after the deployment is executed. - * - * @param after the after value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withAfter(Object after) { - this.after = after; - return this; - } - /** * Get the delta property: The predicted changes to resource properties. * @@ -266,17 +166,6 @@ public List delta() { return this.delta; } - /** - * Set the delta property: The predicted changes to resource properties. - * - * @param delta the delta value to set. - * @return the WhatIfChange object itself. - */ - public WhatIfChange withDelta(List delta) { - this.delta = delta; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java index 6e6c384c7ebc..4f9e638ec908 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,7 +16,7 @@ /** * The predicted change to the resource property. */ -@Fluent +@Immutable public final class WhatIfPropertyChange implements JsonSerializable { /* * The path of the property. @@ -46,7 +46,7 @@ public final class WhatIfPropertyChange implements JsonSerializable children() { return this.children; } - /** - * Set the children property: Nested property changes. - * - * @param children the children value to set. - * @return the WhatIfPropertyChange object itself. - */ - public WhatIfPropertyChange withChildren(List children) { - this.children = children; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java index 9dbf6ba14b38..3a2b64f5a4bf 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; @@ -9,12 +9,12 @@ */ public enum WhatIfResultFormat { /** - * Enum value ResourceIdOnly. + * ResourceIdOnly. */ RESOURCE_ID_ONLY("ResourceIdOnly"), /** - * Enum value FullResourcePayloads. + * FullResourcePayloads. */ FULL_RESOURCE_PAYLOADS("FullResourcePayloads"); diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java index fa558688d935..17948705b4b8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The ZoneMapping model. */ -@Fluent +@Immutable public final class ZoneMapping implements JsonSerializable { /* * The location of the zone mapping. @@ -30,7 +30,7 @@ public final class ZoneMapping implements JsonSerializable { /** * Creates an instance of ZoneMapping class. */ - public ZoneMapping() { + private ZoneMapping() { } /** @@ -42,17 +42,6 @@ public String location() { return this.location; } - /** - * Set the location property: The location of the zone mapping. - * - * @param location the location value to set. - * @return the ZoneMapping object itself. - */ - public ZoneMapping withLocation(String location) { - this.location = location; - return this; - } - /** * Get the zones property: The zones property. * @@ -62,17 +51,6 @@ public List zones() { return this.zones; } - /** - * Set the zones property: The zones property. - * - * @param zones the zones value to set. - * @return the ZoneMapping object itself. - */ - public ZoneMapping withZones(List zones) { - this.zones = zones; - return this; - } - /** * Validates the instance. * diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java index e599cf81653b..f957e0145209 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the data models for ResourceManagementClient. - * ResourceManagement Client. + * Provides operations for working with resources and resource groups. */ package com.azure.resourcemanager.resources.models; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java index c8539836458c..4a07ed5ed32a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the classes for ResourceManagementClient. - * ResourceManagement Client. + * Provides operations for working with resources and resource groups. */ package com.azure.resourcemanager.resources; diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/java/module-info.java b/sdk/resources/azure-resourcemanager-resources/src/main/java/module-info.java index 3971c649f46a..b3f2f5e9666d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/java/module-info.java +++ b/sdk/resources/azure-resourcemanager-resources/src/main/java/module-info.java @@ -63,6 +63,7 @@ // open packages specifically for azure core opens com.azure.resourcemanager.resources.fluent.models to com.azure.core; + opens com.azure.resourcemanager.resources.implementation.models to com.azure.core; opens com.azure.resourcemanager.resources.models to com.azure.core; opens com.azure.resourcemanager.resources.fluentcore.model.implementation to com.azure.core; } diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata.json new file mode 100644 index 000000000000..56f1fe1e9b52 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Resources":"2025-04-01"},"crossLanguagePackageId":"Microsoft.Resources","crossLanguageVersion":"9416f713eeef","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/ProviderResourceTypesClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/ProvidersClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/ResourceGroupsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/ResourceManagementClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/ResourcesClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/TagOperationsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceExpandedInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/GenericResourceInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderPermissionListResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderResourceTypeListResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupExportResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ResourceGroupInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/TagDetailsInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/TagValueInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/TagsResourceInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/ProviderResourceTypesClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/ProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/ResourceGroupsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/ResourceManagementClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/ResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/TagOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/ProviderListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceGroupListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/ResourceListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/TagsListResult.java","src/main/java/com/azure/resourcemanager/resources/models/ActionType.java","src/main/java/com/azure/resourcemanager/resources/models/Alias.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathTokenType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasType.java","src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java","src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateOutputFormat.java","src/main/java/com/azure/resourcemanager/resources/models/ExportTemplateRequest.java","src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocation.java","src/main/java/com/azure/resourcemanager/resources/models/ExtendedLocationType.java","src/main/java/com/azure/resourcemanager/resources/models/Identity.java","src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java","src/main/java/com/azure/resourcemanager/resources/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/resources/models/Origin.java","src/main/java/com/azure/resourcemanager/resources/models/Permission.java","src/main/java/com/azure/resourcemanager/resources/models/Plan.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderConsentDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderPermission.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderRegistrationRequest.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderResourceType.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupPatchable.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceGroupProperties.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/resources/models/ResourcesMoveInfo.java","src/main/java/com/azure/resourcemanager/resources/models/RoleDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/Sku.java","src/main/java/com/azure/resourcemanager/resources/models/TagCount.java","src/main/java/com/azure/resourcemanager/resources/models/Tags.java","src/main/java/com/azure/resourcemanager/resources/models/TagsPatchOperation.java","src/main/java/com/azure/resourcemanager/resources/models/TagsPatchResource.java","src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_databoundary.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_databoundary.json new file mode 100644 index 000000000000..d762fe03253a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_databoundary.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Resources":"2024-08-01"},"crossLanguagePackageId":"Microsoft.Resources","crossLanguageVersion":"df5463e43ce2","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/DataBoundariesManagementClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DataBoundaryDefinitionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/DataBoundariesManagementClientImpl.java","src/main/java/com/azure/resourcemanager/resources/models/DataBoundary.java","src/main/java/com/azure/resourcemanager/resources/models/DataBoundaryProperties.java","src/main/java/com/azure/resourcemanager/resources/models/DefaultName.java","src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deployments.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deployments.json new file mode 100644 index 000000000000..04ac5cfd1a2b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deployments.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Resources":"2025-04-01"},"crossLanguagePackageId":"Microsoft.Resources","crossLanguageVersion":"c73fd33533ac","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentOperationsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsManagementClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExportResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentExtendedInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentOperationInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentValidateResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/ProviderInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/TemplateHashResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/WhatIfOperationResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentOperationsListResult.java","src/main/java/com/azure/resourcemanager/resources/models/Alias.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathTokenType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasType.java","src/main/java/com/azure/resourcemanager/resources/models/ApiProfile.java","src/main/java/com/azure/resourcemanager/resources/models/BasicDependency.java","src/main/java/com/azure/resourcemanager/resources/models/ChangeType.java","src/main/java/com/azure/resourcemanager/resources/models/DebugSetting.java","src/main/java/com/azure/resourcemanager/resources/models/Dependency.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentDiagnosticsDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentExtensionConfigItem.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentExtensionDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentExternalInput.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentExternalInputDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentIdentity.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentIdentityType.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentMode.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentOperationProperties.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentParameter.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentProperties.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentPropertiesExtended.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIf.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfProperties.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentWhatIfSettings.java","src/main/java/com/azure/resourcemanager/resources/models/ErrorAdditionalInfo.java","src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptions.java","src/main/java/com/azure/resourcemanager/resources/models/ExpressionEvaluationOptionsScopeType.java","src/main/java/com/azure/resourcemanager/resources/models/ExtensionConfigPropertyType.java","src/main/java/com/azure/resourcemanager/resources/models/HttpMessage.java","src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java","src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java","src/main/java/com/azure/resourcemanager/resources/models/Level.java","src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeployment.java","src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentExtended.java","src/main/java/com/azure/resourcemanager/resources/models/OnErrorDeploymentType.java","src/main/java/com/azure/resourcemanager/resources/models/ParametersLink.java","src/main/java/com/azure/resourcemanager/resources/models/PropertyChangeType.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderAuthorizationConsentState.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderExtendedLocation.java","src/main/java/com/azure/resourcemanager/resources/models/ProviderResourceType.java","src/main/java/com/azure/resourcemanager/resources/models/ProvisioningOperation.java","src/main/java/com/azure/resourcemanager/resources/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java","src/main/java/com/azure/resourcemanager/resources/models/ScopedDeployment.java","src/main/java/com/azure/resourcemanager/resources/models/ScopedDeploymentWhatIf.java","src/main/java/com/azure/resourcemanager/resources/models/StatusMessage.java","src/main/java/com/azure/resourcemanager/resources/models/TargetResource.java","src/main/java/com/azure/resourcemanager/resources/models/TemplateLink.java","src/main/java/com/azure/resourcemanager/resources/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/resources/models/ValidationLevel.java","src/main/java/com/azure/resourcemanager/resources/models/WhatIfChange.java","src/main/java/com/azure/resourcemanager/resources/models/WhatIfPropertyChange.java","src/main/java/com/azure/resourcemanager/resources/models/WhatIfResultFormat.java","src/main/java/com/azure/resourcemanager/resources/models/ZoneMapping.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deploymentstacks.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deploymentstacks.json new file mode 100644 index 000000000000..fa0f2ab04a7b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_deploymentstacks.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Resources.DeploymentStacks":"2024-03-01"},"crossLanguagePackageId":"Microsoft.Resources.DeploymentStacks","crossLanguageVersion":"ca4ac4d64011","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentStacksManagementClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackTemplateDefinitionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DeploymentStackValidateResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/DeploymentStacksManagementClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/DeploymentStackListResult.java","src/main/java/com/azure/resourcemanager/resources/models/ActionOnUnmanage.java","src/main/java/com/azure/resourcemanager/resources/models/DenySettings.java","src/main/java/com/azure/resourcemanager/resources/models/DenySettingsMode.java","src/main/java/com/azure/resourcemanager/resources/models/DenyStatusMode.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentParameter.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackProvisioningState.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStackValidateProperties.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDebugSetting.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksDeleteDetachEnum.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksParametersLink.java","src/main/java/com/azure/resourcemanager/resources/models/DeploymentStacksTemplateLink.java","src/main/java/com/azure/resourcemanager/resources/models/KeyVaultParameterReference.java","src/main/java/com/azure/resourcemanager/resources/models/KeyVaultReference.java","src/main/java/com/azure/resourcemanager/resources/models/ManagedResourceReference.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceReference.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceReferenceExtended.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceStatusMode.java","src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionManagementGroupMode.java","src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceGroupMode.java","src/main/java/com/azure/resourcemanager/resources/models/UnmanageActionResourceMode.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_policy.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_policy.json new file mode 100644 index 000000000000..7f543ebf41ad --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_policy.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Authorization":"2026-07-01"},"crossLanguagePackageId":"Microsoft.Authorization","crossLanguageVersion":"4111eee490a6","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/DataPolicyManifestsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicyClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionVersionsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicyDefinitionsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionVersionsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicySetDefinitionsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/PolicyTokensClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DataManifestResourceFunctionsDefinition.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/DataPolicyManifestProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyAssignmentUpdateProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionListResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyDefinitionVersionProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionListResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicySetDefinitionVersionProperties.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/PolicyTokenResponseInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/DataPolicyManifestsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyAssignmentsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyDefinitionsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicySetDefinitionsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/PolicyTokensClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/DataPolicyManifestListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyAssignmentListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicyDefinitionListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/PolicySetDefinitionListResult.java","src/main/java/com/azure/resourcemanager/resources/models/Alias.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPath.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathAttributes.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathMetadata.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPathTokenType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPattern.java","src/main/java/com/azure/resourcemanager/resources/models/AliasPatternType.java","src/main/java/com/azure/resourcemanager/resources/models/AliasType.java","src/main/java/com/azure/resourcemanager/resources/models/AssignmentType.java","src/main/java/com/azure/resourcemanager/resources/models/ComplianceState.java","src/main/java/com/azure/resourcemanager/resources/models/DataEffect.java","src/main/java/com/azure/resourcemanager/resources/models/DataManifestCustomResourceFunctionDefinition.java","src/main/java/com/azure/resourcemanager/resources/models/EnforcementMode.java","src/main/java/com/azure/resourcemanager/resources/models/ExternalEndpointResult.java","src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointInvocationResult.java","src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEndpointSettings.java","src/main/java/com/azure/resourcemanager/resources/models/ExternalEvaluationEnforcementSettings.java","src/main/java/com/azure/resourcemanager/resources/models/Identity.java","src/main/java/com/azure/resourcemanager/resources/models/IdentityUserAssignedIdentitiesValue.java","src/main/java/com/azure/resourcemanager/resources/models/NonComplianceMessage.java","src/main/java/com/azure/resourcemanager/resources/models/OverrideKind.java","src/main/java/com/azure/resourcemanager/resources/models/OverrideModel.java","src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValue.java","src/main/java/com/azure/resourcemanager/resources/models/ParameterDefinitionsValueMetadata.java","src/main/java/com/azure/resourcemanager/resources/models/ParameterType.java","src/main/java/com/azure/resourcemanager/resources/models/ParameterValuesValue.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyAction.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyAssignmentUpdate.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionGroup.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyDefinitionReference.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyLogInfo.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenEvaluatedRequestDetails.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenOperation.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenRequest.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyTokenResult.java","src/main/java/com/azure/resourcemanager/resources/models/PolicyType.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceSelector.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceTypeAliases.java","src/main/java/com/azure/resourcemanager/resources/models/Selector.java","src/main/java/com/azure/resourcemanager/resources/models/SelectorKind.java","src/main/java/com/azure/resourcemanager/resources/models/SelfServeExemptionSettings.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_subscription.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_subscription.json new file mode 100644 index 000000000000..e2138bfca4cf --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/azure-resourcemanager-resources_metadata_subscription.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Resources":"2022-12-01"},"crossLanguagePackageId":"Microsoft.Resources","crossLanguageVersion":"95164bd5dca0","generatedFiles":["src/main/java/com/azure/resourcemanager/resources/fluent/ResourceNamesClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/SubscriptionsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/TenantsClient.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckResourceNameResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/CheckZonePeersResultInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/LocationInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/SubscriptionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/TenantIdDescriptionInner.java","src/main/java/com/azure/resourcemanager/resources/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/fluent/package-info.java","src/main/java/com/azure/resourcemanager/resources/implementation/ResourceNamesClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientBuilder.java","src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/SubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/TenantsClientImpl.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/LocationListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/SubscriptionListResult.java","src/main/java/com/azure/resourcemanager/resources/implementation/models/TenantListResult.java","src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZoneMappings.java","src/main/java/com/azure/resourcemanager/resources/models/AvailabilityZonePeers.java","src/main/java/com/azure/resourcemanager/resources/models/CheckZonePeersRequest.java","src/main/java/com/azure/resourcemanager/resources/models/LocationMetadata.java","src/main/java/com/azure/resourcemanager/resources/models/LocationType.java","src/main/java/com/azure/resourcemanager/resources/models/ManagedByTenant.java","src/main/java/com/azure/resourcemanager/resources/models/PairedRegion.java","src/main/java/com/azure/resourcemanager/resources/models/Peers.java","src/main/java/com/azure/resourcemanager/resources/models/RegionCategory.java","src/main/java/com/azure/resourcemanager/resources/models/RegionType.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceName.java","src/main/java/com/azure/resourcemanager/resources/models/ResourceNameStatus.java","src/main/java/com/azure/resourcemanager/resources/models/SpendingLimit.java","src/main/java/com/azure/resourcemanager/resources/models/SubscriptionPolicies.java","src/main/java/com/azure/resourcemanager/resources/models/SubscriptionState.java","src/main/java/com/azure/resourcemanager/resources/models/TenantCategory.java","src/main/java/com/azure/resourcemanager/resources/models/package-info.java","src/main/java/com/azure/resourcemanager/resources/package-info.java"]} \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_deploymentstacks/reflect-config.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_deploymentstacks/reflect-config.json index 70dbd6192c6f..0637a088a01e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_deploymentstacks/reflect-config.json +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_deploymentstacks/reflect-config.json @@ -1 +1 @@ -[{"name":"com.azure.resourcemanager.resources.fluent.models.DeploymentStackInner","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.fluent.models.DeploymentStackProperties","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.fluent.models.DeploymentStackValidateResultInner","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.ActionOnUnmanage","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.AzureResourceBase","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DenySettings","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DeploymentParameter","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DeploymentStackValidateProperties","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DeploymentStacksDebugSetting","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DeploymentStacksParametersLink","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.DeploymentStacksTemplateLink","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.KeyVaultParameterReference","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.KeyVaultReference","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.ManagedResourceReference","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.ResourceReference","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.resources.models.ResourceReferenceExtended","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_policy/proxy-config.json b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_policy/proxy-config.json index 356f6aced4e4..e62bc84ea363 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_policy/proxy-config.json +++ b/sdk/resources/azure-resourcemanager-resources/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-resources_policy/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.resources.implementation.DataPolicyManifestsClientImpl$DataPolicyManifestsService"],["com.azure.resourcemanager.resources.implementation.PolicyAssignmentsClientImpl$PolicyAssignmentsService"],["com.azure.resourcemanager.resources.implementation.PolicyDefinitionVersionsClientImpl$PolicyDefinitionVersionsService"],["com.azure.resourcemanager.resources.implementation.PolicyDefinitionsClientImpl$PolicyDefinitionsService"],["com.azure.resourcemanager.resources.implementation.PolicyExemptionsClientImpl$PolicyExemptionsService"],["com.azure.resourcemanager.resources.implementation.PolicySetDefinitionVersionsClientImpl$PolicySetDefinitionVersionsService"],["com.azure.resourcemanager.resources.implementation.PolicySetDefinitionsClientImpl$PolicySetDefinitionsService"],["com.azure.resourcemanager.resources.implementation.PolicyTokensClientImpl$PolicyTokensService"]] \ No newline at end of file +[["com.azure.resourcemanager.resources.implementation.DataPolicyManifestsClientImpl$DataPolicyManifestsService"],["com.azure.resourcemanager.resources.implementation.PolicyAssignmentsClientImpl$PolicyAssignmentsService"],["com.azure.resourcemanager.resources.implementation.PolicyDefinitionVersionsClientImpl$PolicyDefinitionVersionsService"],["com.azure.resourcemanager.resources.implementation.PolicyDefinitionsClientImpl$PolicyDefinitionsService"],["com.azure.resourcemanager.resources.implementation.PolicySetDefinitionVersionsClientImpl$PolicySetDefinitionVersionsService"],["com.azure.resourcemanager.resources.implementation.PolicySetDefinitionsClientImpl$PolicySetDefinitionsService"],["com.azure.resourcemanager.resources.implementation.PolicyTokensClientImpl$PolicyTokensService"]] \ No newline at end of file diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/AuthorizationOperationsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/AuthorizationOperationsListSamples.java new file mode 100644 index 000000000000..cdcf31416dc7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/AuthorizationOperationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for AuthorizationOperations List. + */ +public final class AuthorizationOperationsListSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ListProviderOperations.json + */ + /** + * Sample code: List provider operations. + * + * @param manager Entry point to ResourceManager. + */ + public static void listProviderOperations(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient().getAuthorizationOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesGetSamples.java new file mode 100644 index 000000000000..3ee7fd85528b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Changes Get. + */ +public final class ChangesGetSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Resources/changes/stable/2022-05-01/examples/GetChange.json + */ + /** + * Sample code: GetChange. + * + * @param manager Entry point to ResourceManager. + */ + public static void getChange(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.resourceChangeClient() + .getChanges() + .getWithResponse("resourceGroup1", "resourceProvider1", "resourceType1", "resourceName1", + "1d58d72f-0719-4a48-9228-b7ea682885bf", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesListSamples.java new file mode 100644 index 000000000000..2ff2a22e2b83 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ChangesListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Changes List. + */ +public final class ChangesListSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Resources/changes/stable/2022-05-01/examples/ListChanges.json + */ + /** + * Sample code: ListChanges. + * + * @param manager Entry point to ResourceManager. + */ + public static void listChanges(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.resourceChangeClient() + .getChanges() + .list("resourceGroup1", "resourceProvider1", "resourceType1", "resourceName1", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetScopeSamples.java new file mode 100644 index 000000000000..81ef265037a5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetScopeSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DefaultName; + +/** + * Samples for DataBoundaries GetScope. + */ +public final class DataBoundariesGetScopeSamples { + /* + * x-ms-original-file: 2024-08-01/GetScopedDataBoundary.json + */ + /** + * Sample code: Get data boundary at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void getDataBoundaryAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.dataBoundaryClient() + .getDataBoundaries() + .getScopeWithResponse("subscriptions/11111111-1111-1111-1111-111111111111/resourcegroups/my-resource-group", + DefaultName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetTenantSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetTenantSamples.java new file mode 100644 index 000000000000..4d0cd749c176 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesGetTenantSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DefaultName; + +/** + * Samples for DataBoundaries GetTenant. + */ +public final class DataBoundariesGetTenantSamples { + /* + * x-ms-original-file: 2024-08-01/GetTenantDataBoundary.json + */ + /** + * Sample code: Get data boundary for tenant. + * + * @param manager Entry point to ResourceManager. + */ + public static void getDataBoundaryForTenant(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.dataBoundaryClient() + .getDataBoundaries() + .getTenantWithResponse(DefaultName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesPutSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesPutSamples.java new file mode 100644 index 000000000000..e351e73443cd --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataBoundariesPutSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DataBoundaryDefinitionInner; +import com.azure.resourcemanager.resources.models.DataBoundary; +import com.azure.resourcemanager.resources.models.DataBoundaryProperties; +import com.azure.resourcemanager.resources.models.DefaultName; + +/** + * Samples for DataBoundaries Put. + */ +public final class DataBoundariesPutSamples { + /* + * x-ms-original-file: 2024-08-01/PutDataBoundary.json + */ + /** + * Sample code: Opt-in to data boundary. + * + * @param manager Entry point to ResourceManager. + */ + public static void optInToDataBoundary(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.dataBoundaryClient() + .getDataBoundaries() + .putWithResponse(DefaultName.DEFAULT, new DataBoundaryDefinitionInner().withProperties( + new DataBoundaryProperties().withDataBoundary(DataBoundary.EU)), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsGetByPolicyModeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsGetByPolicyModeSamples.java index 5cd975bf3c85..bc54370e77b0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsGetByPolicyModeSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsGetByPolicyModeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class DataPolicyManifestsGetByPolicyModeSamples { /* - * x-ms-original-file: - * specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2020-09-01/examples/ - * getDataPolicyManifest.json + * x-ms-original-file: 2025-11-01/getDataPolicyManifest.json */ /** * Sample code: Retrieve a data policy manifest by policy mode. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsListSamples.java index fe1a5b770ccb..1c17d66ed5e8 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DataPolicyManifestsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class DataPolicyManifestsListSamples { /* - * x-ms-original-file: - * specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2020-09-01/examples/ - * listDataPolicyManifests.json + * x-ms-original-file: 2025-11-01/listDataPolicyManifests.json */ /** * Sample code: List data policy manifests. @@ -23,9 +21,7 @@ public static void listDataPolicyManifests(com.azure.resourcemanager.resources.R } /* - * x-ms-original-file: - * specification/resources/resource-manager/Microsoft.Authorization/policy/stable/2020-09-01/examples/ - * listDataPolicyManifestsNamespaceFilter.json + * x-ms-original-file: 2025-11-01/listDataPolicyManifestsNamespaceFilter.json */ /** * Sample code: List data policy manifests with namespace filter. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCalculateTemplateHashSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCalculateTemplateHashSamples.java new file mode 100644 index 000000000000..87769c2af5e9 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCalculateTemplateHashSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** + * Samples for Deployments CalculateTemplateHash. + */ +public final class DeploymentsCalculateTemplateHashSamples { + /* + * x-ms-original-file: 2025-04-01/CalculateTemplateHash.json + */ + /** + * Sample code: Calculate template hash. + * + * @param manager Entry point to ResourceManager. + */ + public static void calculateTemplateHash(com.azure.resourcemanager.resources.ResourceManager manager) + throws IOException { + manager.deploymentClient() + .getDeployments() + .calculateTemplateHashWithResponse(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview\",\"contentVersion\":\"1.0.0.0\",\"outputs\":{\"string\":{\"type\":\"string\",\"value\":\"myvalue\"}},\"parameters\":{\"string\":{\"type\":\"string\"}},\"resources\":[],\"variables\":{\"array\":[1,2,3,4],\"bool\":true,\"int\":42,\"object\":{\"object\":{\"location\":\"West US\",\"vmSize\":\"Large\"}},\"string\":\"string\"}}", + Object.class, SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java new file mode 100644 index 000000000000..3aa31b9cfa66 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.ScopedDeployment; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments CreateOrUpdateAtManagementGroupScope. + */ +public final class DeploymentsCreateOrUpdateAtManagementGroupScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PutDeploymentAtManagementGroup.json + */ + /** + * Sample code: Create deployment at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + createDeploymentAtManagementGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdateAtManagementGroupScope("my-management-group-id", "my-deployment", + new ScopedDeployment().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtScopeSamples.java new file mode 100644 index 000000000000..fdfc5dc569ef --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtScopeSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments CreateOrUpdateAtScope. + */ +public final class DeploymentsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PutDeploymentAtScope.json + */ + /** + * Sample code: Create deployment at a given scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtAGivenScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdateAtScope("providers/Microsoft.Management/managementGroups/my-management-group-id", + "my-deployment", + new DeploymentInner().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java new file mode 100644 index 000000000000..9c95d8ebae08 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments CreateOrUpdateAtSubscriptionScope. + */ +public final class DeploymentsCreateOrUpdateAtSubscriptionScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdateAtSubscriptionScope("my-deployment", new DeploymentInner().withLocation("eastus") + .withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink().withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java new file mode 100644 index 000000000000..1dc8128f9a9e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.ScopedDeployment; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments CreateOrUpdateAtTenantScope. + */ +public final class DeploymentsCreateOrUpdateAtTenantScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PutDeploymentAtTenant.json + */ + /** + * Sample code: Create deployment at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtTenantScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdateAtTenantScope("tenant-dep01", + new ScopedDeployment().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0fa827892b67 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsCreateOrUpdateSamples.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentExternalInput; +import com.azure.resourcemanager.resources.models.DeploymentExternalInputDefinition; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentParameter; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.OnErrorDeployment; +import com.azure.resourcemanager.resources.models.OnErrorDeploymentType; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments CreateOrUpdate. + */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-04-01/PutDeploymentWithExternalInputs.json + */ + /** + * Sample code: Create deployment using external inputs. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentUsingExternalInputs(com.azure.resourcemanager.resources.ResourceManager manager) + throws IOException { + manager.deploymentClient() + .getDeployments() + .createOrUpdate("my-resource-group", "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties().withTemplate(SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\"contentVersion\":\"1.0.0.0\",\"outputs\":{\"inputObj\":{\"type\":\"object\",\"value\":\"[parameters('inputObj')]\"}},\"parameters\":{\"inputObj\":{\"type\":\"object\"}},\"resources\":[]}", + Object.class, SerializerEncoding.JSON)) + .withParameters(mapOf("inputObj", + new DeploymentParameter().withExpression("[createObject('foo', externalInputs('fooValue'))]"))) + .withExternalInputs(mapOf("fooValue", new DeploymentExternalInput().withValue("baz"))) + .withExternalInputDefinitions(mapOf("fooValue", + new DeploymentExternalInputDefinition().withKind("sys.envVar").withConfig("FOO_VALUE"))) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PutDeploymentResourceGroup.json + */ + /** + * Sample code: Create a deployment that will deploy a template with a uri and queryString. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateWithAUriAndQueryString( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdate("my-resource-group", "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink() + .withUri("https://example.com/exampleTemplate.json") + .withQueryString( + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdate("my-resource-group", "my-deployment", new DeploymentInner() + .withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink().withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ + /** + * Sample code: Create a deployment that will redeploy the last successful deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdate("my-resource-group", "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.LAST_SUCCESSFUL))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ + /** + * Sample code: Create a deployment that will redeploy another deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployAnotherDeploymentOnFailure( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .createOrUpdate("my-resource-group", "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.SPECIFIC_DEPLOYMENT) + .withDeploymentName("name-of-deployment-to-use"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtManagementGroupScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtManagementGroupScopeSamples.java new file mode 100644 index 000000000000..22a265846d69 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtManagementGroupScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.ScopedDeployment; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments ValidateAtManagementGroupScope. + */ +public final class DeploymentsValidateAtManagementGroupScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentValidateOnManagementGroup.json + */ + /** + * Sample code: Validates a template at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + validatesATemplateAtManagementGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .validateAtManagementGroupScope("my-management-group-id", "my-deployment", + new ScopedDeployment().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtScopeSamples.java new file mode 100644 index 000000000000..44a0569fafe9 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtScopeSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments ValidateAtScope. + */ +public final class DeploymentsValidateAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentValidateOnScope.json + */ + /** + * Sample code: Validates a template at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void validatesATemplateAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .validateAtScope("subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group", + "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink() + .withUri("https://example.com/exampleTemplate.json") + .withQueryString( + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtSubscriptionScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtSubscriptionScopeSamples.java new file mode 100644 index 000000000000..ad0e847b7792 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtSubscriptionScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments ValidateAtSubscriptionScope. + */ +public final class DeploymentsValidateAtSubscriptionScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentValidateOnSubscription.json + */ + /** + * Sample code: Validates a template at subscription scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + validatesATemplateAtSubscriptionScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .validateAtSubscriptionScope("my-deployment", + new DeploymentInner().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtTenantScopeSamples.java new file mode 100644 index 000000000000..40ef9b99a81a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateAtTenantScopeSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.ScopedDeployment; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments ValidateAtTenantScope. + */ +public final class DeploymentsValidateAtTenantScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentValidateOnTenant.json + */ + /** + * Sample code: Validates a template at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void validatesATemplateAtTenantScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .validateAtTenantScope("my-deployment", + new ScopedDeployment().withLocation("eastus") + .withProperties(new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateSamples.java new file mode 100644 index 000000000000..197b61c57929 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsValidateSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments Validate. + */ +public final class DeploymentsValidateSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentValidateOnResourceGroup.json + */ + /** + * Sample code: Validates a template at resource group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + validatesATemplateAtResourceGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .validate("my-resource-group", "my-deployment", + new DeploymentInner().withProperties(new DeploymentProperties().withTemplateLink(new TemplateLink() + .withUri("https://example.com/exampleTemplate.json") + .withQueryString( + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java new file mode 100644 index 000000000000..996c68dfe2c1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments WhatIfAtManagementGroupScope. + */ +public final class DeploymentsWhatIfAtManagementGroupScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentWhatIfOnManagementGroup.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + predictTemplateChangesAtManagementGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .whatIfAtManagementGroupScope("myManagementGruop", "exampleDeploymentName", + new ScopedDeploymentWhatIf().withLocation("eastus") + .withProperties(new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java new file mode 100644 index 000000000000..94123eb5c34f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments WhatIfAtSubscriptionScope. + */ +public final class DeploymentsWhatIfAtSubscriptionScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentWhatIfOnSubscription.json + */ + /** + * Sample code: Predict template changes at subscription scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + predictTemplateChangesAtSubscriptionScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .whatIfAtSubscriptionScope("my-deployment", + new DeploymentWhatIf().withLocation("westus") + .withProperties(new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtTenantScopeSamples.java new file mode 100644 index 000000000000..b80233a350e2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfAtTenantScopeSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments WhatIfAtTenantScope. + */ +public final class DeploymentsWhatIfAtTenantScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentWhatIfOnTenant.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + predictTemplateChangesAtManagementGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .whatIfAtTenantScope("exampleDeploymentName", + new ScopedDeploymentWhatIf().withLocation("eastus") + .withProperties(new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfSamples.java new file mode 100644 index 000000000000..df06a736191c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/DeploymentsWhatIfSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.DeploymentMode; +import com.azure.resourcemanager.resources.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.models.TemplateLink; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Deployments WhatIf. + */ +public final class DeploymentsWhatIfSamples { + /* + * x-ms-original-file: 2025-04-01/PostDeploymentWhatIfOnResourceGroup.json + */ + /** + * Sample code: Predict template changes at resource group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void + predictTemplateChangesAtResourceGroupScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.deploymentClient() + .getDeployments() + .whatIf("my-resource-group", "my-deployment", + new DeploymentWhatIf().withProperties(new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters(mapOf()) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesGetSamples.java new file mode 100644 index 000000000000..cb3a60bdd79a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Features Get. + */ +public final class FeaturesGetSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/getFeature.json + */ + /** + * Sample code: Get feature. + * + * @param manager Entry point to ResourceManager. + */ + public static void getFeature(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getFeatures() + .getWithResponse("Resource Provider Namespace", "feature", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListAllSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListAllSamples.java new file mode 100644 index 000000000000..ad2a7596380a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListAllSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Features ListAll. + */ +public final class FeaturesListAllSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * listSubscriptionFeatures.json + */ + /** + * Sample code: List subscription Features. + * + * @param manager Entry point to ResourceManager. + */ + public static void listSubscriptionFeatures(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient().getFeatures().listAll(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListSamples.java new file mode 100644 index 000000000000..f60e1a979fac --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Features List. + */ +public final class FeaturesListSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * listProviderFeatures.json + */ + /** + * Sample code: List provider Features. + * + * @param manager Entry point to ResourceManager. + */ + public static void listProviderFeatures(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient().getFeatures().list("Resource Provider Namespace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesRegisterSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesRegisterSamples.java new file mode 100644 index 000000000000..a9a3d539a1bb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesRegisterSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Features Register. + */ +public final class FeaturesRegisterSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/registerFeature. + * json + */ + /** + * Sample code: Register feature. + * + * @param manager Entry point to ResourceManager. + */ + public static void registerFeature(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getFeatures() + .registerWithResponse("Resource Provider Namespace", "feature", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesUnregisterSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesUnregisterSamples.java new file mode 100644 index 000000000000..d4c3c2fbc6cd --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/FeaturesUnregisterSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Features Unregister. + */ +public final class FeaturesUnregisterSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/unregisterFeature + * .json + */ + /** + * Sample code: Register feature. + * + * @param manager Entry point to ResourceManager. + */ + public static void registerFeature(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getFeatures() + .unregisterWithResponse("Resource Provider Namespace", "feature", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceGroupLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceGroupLevelSamples.java new file mode 100644 index 000000000000..a6723ad2a056 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceGroupLevelSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; +import com.azure.resourcemanager.resources.models.LockLevel; + +/** + * Samples for ManagementLocks CreateOrUpdateAtResourceGroupLevel. + */ +public final class ManagementLocksCreateOrUpdateAtResourceGroupLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_CreateOrUpdateAtResourceGroupLevel.json + */ + /** + * Sample code: Create management lock at resource group level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + createManagementLockAtResourceGroupLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .createOrUpdateAtResourceGroupLevelWithResponse("resourcegroupname", "testlock", + new ManagementLockObjectInner().withLevel(LockLevel.READ_ONLY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceLevelSamples.java new file mode 100644 index 000000000000..e2f6e598e7bd --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtResourceLevelSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; +import com.azure.resourcemanager.resources.models.LockLevel; + +/** + * Samples for ManagementLocks CreateOrUpdateAtResourceLevel. + */ +public final class ManagementLocksCreateOrUpdateAtResourceLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_CreateOrUpdateAtResourceLevel.json + */ + /** + * Sample code: Create management lock at resource level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + createManagementLockAtResourceLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .createOrUpdateAtResourceLevelWithResponse("resourcegroupname", "Microsoft.Storage", "parentResourcePath", + "storageAccounts", "teststorageaccount", "testlock", + new ManagementLockObjectInner().withLevel(LockLevel.READ_ONLY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtSubscriptionLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtSubscriptionLevelSamples.java new file mode 100644 index 000000000000..959d1a910c18 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateAtSubscriptionLevelSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; +import com.azure.resourcemanager.resources.models.LockLevel; + +/** + * Samples for ManagementLocks CreateOrUpdateAtSubscriptionLevel. + */ +public final class ManagementLocksCreateOrUpdateAtSubscriptionLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_CreateOrUpdateAtSubscriptionLevel.json + */ + /** + * Sample code: Create management lock at subscription level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + createManagementLockAtSubscriptionLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .createOrUpdateAtSubscriptionLevelWithResponse("testlock", + new ManagementLockObjectInner().withLevel(LockLevel.READ_ONLY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateByScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateByScopeSamples.java new file mode 100644 index 000000000000..57e135c5ba94 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksCreateOrUpdateByScopeSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.ManagementLockObjectInner; +import com.azure.resourcemanager.resources.models.LockLevel; + +/** + * Samples for ManagementLocks CreateOrUpdateByScope. + */ +public final class ManagementLocksCreateOrUpdateByScopeSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_CreateOrUpdateAtScope.json + */ + /** + * Sample code: Create management lock at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createManagementLockAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .createOrUpdateByScopeWithResponse("subscriptions/subscriptionId", "testlock", + new ManagementLockObjectInner().withLevel(LockLevel.READ_ONLY), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtResourceLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtResourceLevelSamples.java new file mode 100644 index 000000000000..a6e4014f327d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtResourceLevelSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks DeleteAtResourceLevel. + */ +public final class ManagementLocksDeleteAtResourceLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_DeleteAtResourceLevel.json + */ + /** + * Sample code: Delete management lock at resource level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + deleteManagementLockAtResourceLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .deleteAtResourceLevelWithResponse("resourcegroupname", "Microsoft.Storage", "parentResourcePath", + "storageAccounts", "teststorageaccount", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtSubscriptionLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtSubscriptionLevelSamples.java new file mode 100644 index 000000000000..9e5d8346b839 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteAtSubscriptionLevelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks DeleteAtSubscriptionLevel. + */ +public final class ManagementLocksDeleteAtSubscriptionLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_DeleteAtSubscriptionLevel.json + */ + /** + * Sample code: Delete management lock at subscription level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + deleteManagementLockAtSubscriptionLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .deleteAtSubscriptionLevelWithResponse("testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteByScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteByScopeSamples.java new file mode 100644 index 000000000000..90d5d142e2f8 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteByScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks DeleteByScope. + */ +public final class ManagementLocksDeleteByScopeSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_DeleteAtScope.json + */ + /** + * Sample code: Delete management lock at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void deleteManagementLockAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .deleteByScopeWithResponse("subscriptions/subscriptionId", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteSamples.java new file mode 100644 index 000000000000..76dfd32e6af2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks Delete. + */ +public final class ManagementLocksDeleteSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_DeleteAtResourceGroupLevel.json + */ + /** + * Sample code: Delete management lock at resource group level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + deleteManagementLockAtResourceGroupLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .deleteWithResponse("resourcegroupname", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtResourceLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtResourceLevelSamples.java new file mode 100644 index 000000000000..dbb4af62e65d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtResourceLevelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks GetAtResourceLevel. + */ +public final class ManagementLocksGetAtResourceLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_GetAtResourceLevel.json + */ + /** + * Sample code: Get management lock at resource level. + * + * @param manager Entry point to ResourceManager. + */ + public static void getManagementLockAtResourceLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .getAtResourceLevelWithResponse("resourcegroupname", "Microsoft.Storage", "parentResourcePath", + "storageAccounts", "teststorageaccount", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtSubscriptionLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtSubscriptionLevelSamples.java new file mode 100644 index 000000000000..be256d01b181 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetAtSubscriptionLevelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks GetAtSubscriptionLevel. + */ +public final class ManagementLocksGetAtSubscriptionLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_GetAtSubscriptionLevel.json + */ + /** + * Sample code: Get management lock at subscription level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + getManagementLockAtSubscriptionLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .getAtSubscriptionLevelWithResponse("testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByResourceGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..fb86fff996be --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks GetByResourceGroup. + */ +public final class ManagementLocksGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_GetAtResourceGroupLevel.json + */ + /** + * Sample code: Get management lock at resource group level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + getManagementLockAtResourceGroupLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .getByResourceGroupWithResponse("resourcegroupname", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByScopeSamples.java new file mode 100644 index 000000000000..13d991e3e5c6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksGetByScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks GetByScope. + */ +public final class ManagementLocksGetByScopeSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_GetAtScope.json + */ + /** + * Sample code: Get management lock at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void getManagementLockAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .getByScopeWithResponse("subscriptions/subscriptionId", "testlock", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListAtResourceLevelSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListAtResourceLevelSamples.java new file mode 100644 index 000000000000..3853d2b19269 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListAtResourceLevelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks ListAtResourceLevel. + */ +public final class ManagementLocksListAtResourceLevelSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_ListAtResourceLevel.json + */ + /** + * Sample code: List management locks at resource level. + * + * @param manager Entry point to ResourceManager. + */ + public static void listManagementLocksAtResourceLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .listAtResourceLevel("resourcegroupname", "Microsoft.Storage", "parentResourcePath", "storageAccounts", + "teststorageaccount", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByResourceGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByResourceGroupSamples.java new file mode 100644 index 000000000000..c23b9c76487c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByResourceGroupSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks ListByResourceGroup. + */ +public final class ManagementLocksListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_ListAtResourceGroupLevel.json + */ + /** + * Sample code: List management groups at resource group level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + listManagementGroupsAtResourceGroupLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .listByResourceGroup("resourcegroupname", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByScopeSamples.java new file mode 100644 index 000000000000..01b4ba399690 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListByScopeSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks ListByScope. + */ +public final class ManagementLocksListByScopeSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_ListAtScope.json + */ + /** + * Sample code: List management locks at scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void listManagementLocksAtScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient() + .getManagementLocks() + .listByScope("subscriptions/subscriptionId", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListSamples.java new file mode 100644 index 000000000000..cb0741049b75 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ManagementLocksListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ManagementLocks List. + */ +public final class ManagementLocksListSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Authorization/locks/stable/2017-04-01/examples/ + * ManagementLocks_ListAtSubscriptionLevel.json + */ + /** + * Sample code: List management locks at subscription level. + * + * @param manager Entry point to ResourceManager. + */ + public static void + listManagementLocksAtSubscriptionLevel(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.managementLockClient().getManagementLocks().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateByIdSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateByIdSamples.java deleted file mode 100644 index aa8a81ea8a3e..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateByIdSamples.java +++ /dev/null @@ -1,95 +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.resources.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner; -import com.azure.resourcemanager.resources.models.EnforcementMode; -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.ParameterValuesValue; -import com.azure.resourcemanager.resources.models.ResourceIdentityType; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for PolicyAssignments CreateById. - */ -public final class PolicyAssignmentsCreateByIdSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentById.json - */ - /** - * Sample code: Create or update policy assignment by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void createOrUpdatePolicyAssignmentByID(com.azure.resourcemanager.resources.ResourceManager manager) - throws IOException { - manager.policyClient() - .getPolicyAssignments() - .createByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - new PolicyAssignmentInner().withDisplayName("Enforce storage account SKU") - .withPolicyDefinitionId( - "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1") - .withDefinitionVersion("1.*.*") - .withParameters(mapOf("listOfAllowedSKUs", new ParameterValuesValue().withValue(SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("[\"Standard_GRS\",\"Standard_LRS\"]", Object.class, SerializerEncoding.JSON)))) - .withDescription("Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"assignedBy\":\"Cheapskate Boss\"}", Object.class, SerializerEncoding.JSON)) - .withEnforcementMode(EnforcementMode.DEFAULT), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithIdentityById.json - */ - /** - * Sample code: Create or update policy assignment with a managed identity by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void createOrUpdatePolicyAssignmentWithAManagedIdentityByID( - com.azure.resourcemanager.resources.ResourceManager manager) throws IOException { - manager.policyClient() - .getPolicyAssignments() - .createByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - new PolicyAssignmentInner().withLocation("eastus") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withDisplayName("Enforce storage account SKU") - .withPolicyDefinitionId( - "/providers/Microsoft.Authorization/policyDefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1") - .withDefinitionVersion("1.*.*") - .withParameters(mapOf("listOfAllowedSKUs", new ParameterValuesValue().withValue(SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize("[\"Standard_GRS\",\"Standard_LRS\"]", Object.class, SerializerEncoding.JSON)))) - .withDescription("Allow only storage accounts of SKU Standard_GRS or Standard_LRS to be created") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"assignedBy\":\"Cheapskate Boss\"}", Object.class, SerializerEncoding.JSON)) - .withEnforcementMode(EnforcementMode.DEFAULT), - com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateSamples.java index 6ed94bbb6fbe..01621b8c3f00 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsCreateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -18,6 +18,7 @@ import com.azure.resourcemanager.resources.models.ResourceSelector; import com.azure.resourcemanager.resources.models.Selector; import com.azure.resourcemanager.resources.models.SelectorKind; +import com.azure.resourcemanager.resources.models.SelfServeExemptionSettings; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; @@ -28,9 +29,7 @@ */ public final class PolicyAssignmentsCreateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithResourceSelectors.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithResourceSelectors.json */ /** * Sample code: Create or update a policy assignment with resource selectors. @@ -55,9 +54,7 @@ public static void createOrUpdateAPolicyAssignmentWithResourceSelectors( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithEnrollEnforcement.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithEnrollEnforcement.json */ /** * Sample code: Create or update a policy assignment to enforce policy effect only on enrolled resources during @@ -84,9 +81,7 @@ public static void createOrUpdateAPolicyAssignmentWithResourceSelectors( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignment.json + * x-ms-original-file: 2025-11-01/createPolicyAssignment.json */ /** * Sample code: Create or update a policy assignment. @@ -112,9 +107,7 @@ public static void createOrUpdateAPolicyAssignment(com.azure.resourcemanager.res } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithIdentity.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithIdentity.json */ /** * Sample code: Create or update a policy assignment with a system assigned identity. @@ -141,9 +134,34 @@ public static void createOrUpdateAPolicyAssignmentWithASystemAssignedIdentity( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentNonComplianceMessages.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithSelfserveExemptionSettings.json + */ + /** + * Sample code: Create or update a policy assignment with self-serve exemption settings. + * + * @param manager Entry point to ResourceManager. + */ + public static void createOrUpdateAPolicyAssignmentWithSelfServeExemptionSettings( + com.azure.resourcemanager.resources.ResourceManager manager) throws IOException { + manager.policyClient() + .getPolicyAssignments() + .createWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "CostManagement", + new PolicyAssignmentInner().withLocation("eastus") + .withDisplayName("Limit the resource location and resource SKU") + .withPolicyDefinitionId( + "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policySetDefinitions/CostManagement") + .withDefinitionVersion("1.*.*") + .withDescription("Limit the resource location and resource SKU") + .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"assignedBy\":\"Foo Bar\"}", Object.class, SerializerEncoding.JSON)) + .withEnforcementMode(EnforcementMode.DEFAULT) + .withSelfServeExemptionSettings(new SelfServeExemptionSettings().withEnabled(true) + .withPolicyDefinitionReferenceIds(Arrays.asList("Limit_Skus"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-11-01/createPolicyAssignmentNonComplianceMessages.json */ /** * Sample code: Create or update a policy assignment with multiple non-compliance messages. @@ -169,9 +187,7 @@ public static void createOrUpdateAPolicyAssignmentWithMultipleNonComplianceMessa } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithUserAssignedIdentity.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithUserAssignedIdentity.json */ /** * Sample code: Create or update a policy assignment with a user assigned identity. @@ -201,9 +217,7 @@ public static void createOrUpdateAPolicyAssignmentWithAUserAssignedIdentity( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithOverrides.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithOverrides.json */ /** * Sample code: Create or update a policy assignment with overrides. @@ -238,9 +252,7 @@ public static void createOrUpdateAPolicyAssignmentWithOverrides( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createPolicyAssignmentWithoutEnforcement.json + * x-ms-original-file: 2025-11-01/createPolicyAssignmentWithoutEnforcement.json */ /** * Sample code: Create or update a policy assignment without enforcing policy effect during resource creation or diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteByIdSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteByIdSamples.java deleted file mode 100644 index 3548fb07abf0..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteByIdSamples.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.resources.generated; - -/** - * Samples for PolicyAssignments DeleteById. - */ -public final class PolicyAssignmentsDeleteByIdSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyAssignmentById.json - */ - /** - * Sample code: Delete a policy assignment by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void deleteAPolicyAssignmentByID(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyAssignments() - .deleteByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteSamples.java index 5e5a5d3e9121..9c81bf0edba9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyAssignmentsDeleteSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyAssignment.json + * x-ms-original-file: 2025-11-01/deletePolicyAssignment.json */ /** * Sample code: Delete a policy assignment. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetByIdSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetByIdSamples.java deleted file mode 100644 index 6358ea1d7686..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetByIdSamples.java +++ /dev/null @@ -1,47 +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.resources.generated; - -/** - * Samples for PolicyAssignments GetById. - */ -public final class PolicyAssignmentsGetByIdSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentById.json - */ - /** - * Sample code: Retrieve a policy assignment by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void retrieveAPolicyAssignmentByID(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyAssignments() - .getByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentWithIdentityById.json - */ - /** - * Sample code: Retrieve a policy assignment with a managed identity by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void - retrieveAPolicyAssignmentWithAManagedIdentityByID(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyAssignments() - .getByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetSamples.java index 74ccb1bf58eb..4934b1589b3f 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyAssignmentsGetSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentWithOverrides.json + * x-ms-original-file: 2025-11-01/getPolicyAssignmentWithOverrides.json */ /** * Sample code: Retrieve a policy assignment with overrides. @@ -27,45 +25,39 @@ public final class PolicyAssignmentsGetSamples { } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentWithUserAssignedIdentity.json + * x-ms-original-file: 2025-11-01/getPolicyAssignmentWithResourceSelectors.json */ /** - * Sample code: Retrieve a policy assignment with a user assigned identity. + * Sample code: Retrieve a policy assignment with resource selectors. * * @param manager Entry point to ResourceManager. */ - public static void retrieveAPolicyAssignmentWithAUserAssignedIdentity( - com.azure.resourcemanager.resources.ResourceManager manager) { + public static void + retrieveAPolicyAssignmentWithResourceSelectors(com.azure.resourcemanager.resources.ResourceManager manager) { manager.policyClient() .getPolicyAssignments() - .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "EnforceNaming", null, + .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "CostManagement", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentWithResourceSelectors.json + * x-ms-original-file: 2025-11-01/getPolicyAssignmentWithUserAssignedIdentity.json */ /** - * Sample code: Retrieve a policy assignment with resource selectors. + * Sample code: Retrieve a policy assignment with a user assigned identity. * * @param manager Entry point to ResourceManager. */ - public static void - retrieveAPolicyAssignmentWithResourceSelectors(com.azure.resourcemanager.resources.ResourceManager manager) { + public static void retrieveAPolicyAssignmentWithAUserAssignedIdentity( + com.azure.resourcemanager.resources.ResourceManager manager) { manager.policyClient() .getPolicyAssignments() - .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "CostManagement", null, + .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "EnforceNaming", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignment.json + * x-ms-original-file: 2025-11-01/getPolicyAssignment.json */ /** * Sample code: Retrieve a policy assignment. @@ -80,9 +72,7 @@ public static void retrieveAPolicyAssignment(com.azure.resourcemanager.resources } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyAssignmentWithIdentity.json + * x-ms-original-file: 2025-11-01/getPolicyAssignmentWithIdentity.json */ /** * Sample code: Retrieve a policy assignment with a system assigned identity. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListByResourceGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListByResourceGroupSamples.java index 6e937406e16e..bd00bbabd473 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListByResourceGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyAssignmentsListByResourceGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyAssignmentsForResourceGroup.json + * x-ms-original-file: 2025-11-01/listPolicyAssignmentsForResourceGroup.json */ /** * Sample code: List policy assignments that apply to a resource group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForManagementGroupSamples.java index 6d74a99e46a3..a85b5857bf04 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyAssignmentsListForManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyAssignmentsForManagementGroup.json + * x-ms-original-file: 2025-11-01/listPolicyAssignmentsForManagementGroup.json */ /** * Sample code: List policy assignments that apply to a management group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForResourceSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForResourceSamples.java index 88672eff24d1..04bf49e4b643 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForResourceSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListForResourceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,17 +9,15 @@ */ public final class PolicyAssignmentsListForResourceSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyAssignmentsForResource.json + * x-ms-original-file: 2025-11-01/listPolicyAssignmentsForResource.json */ /** - * Sample code: List all policy assignments that apply to a resource. + * Sample code: List policy assignments that apply to a resource group. * * @param manager Entry point to ResourceManager. */ public static void - listAllPolicyAssignmentsThatApplyToAResource(com.azure.resourcemanager.resources.ResourceManager manager) { + listPolicyAssignmentsThatApplyToAResourceGroup(com.azure.resourcemanager.resources.ResourceManager manager) { manager.policyClient() .getPolicyAssignments() .listForResource("TestResourceGroup", "Microsoft.Compute", "virtualMachines/MyTestVm", "domainNames", diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListSamples.java index bc6d64c670cf..3b66c81e7d95 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyAssignmentsListSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyAssignments.json + * x-ms-original-file: 2025-11-01/listPolicyAssignments.json */ /** * Sample code: List policy assignments that apply to a subscription. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateByIdSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateByIdSamples.java deleted file mode 100644 index 56230026912b..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateByIdSamples.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.resources.generated; - -import com.azure.resourcemanager.resources.models.Identity; -import com.azure.resourcemanager.resources.models.PolicyAssignmentUpdate; -import com.azure.resourcemanager.resources.models.ResourceIdentityType; - -/** - * Samples for PolicyAssignments UpdateById. - */ -public final class PolicyAssignmentsUpdateByIdSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/updatePolicyAssignmentWithIdentityById.json - */ - /** - * Sample code: Update policy assignment with a managed identity by ID. - * - * @param manager Entry point to ResourceManager. - */ - public static void - updatePolicyAssignmentWithAManagedIdentityByID(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyAssignments() - .updateByIdWithResponse( - "providers/Microsoft.Management/managementGroups/MyManagementGroup/providers/Microsoft.Authorization/policyAssignments/LowCostStorage", - new PolicyAssignmentUpdate().withLocation("eastus") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateSamples.java index 72b2f4bb957e..ee512438ae25 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyAssignmentsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.resources.models.ResourceSelector; import com.azure.resourcemanager.resources.models.Selector; import com.azure.resourcemanager.resources.models.SelectorKind; +import com.azure.resourcemanager.resources.models.SelfServeExemptionSettings; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -22,9 +23,7 @@ */ public final class PolicyAssignmentsUpdateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/updatePolicyAssignmentWithResourceSelectors.json + * x-ms-original-file: 2025-11-01/updatePolicyAssignmentWithResourceSelectors.json */ /** * Sample code: Update a policy assignment with resource selectors. @@ -44,9 +43,7 @@ public final class PolicyAssignmentsUpdateSamples { } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/updatePolicyAssignmentWithUserAssignedIdentity.json + * x-ms-original-file: 2025-11-01/updatePolicyAssignmentWithUserAssignedIdentity.json */ /** * Sample code: Update a policy assignment with a user assigned identity. @@ -67,9 +64,7 @@ public final class PolicyAssignmentsUpdateSamples { } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/updatePolicyAssignmentWithOverrides.json + * x-ms-original-file: 2025-11-01/updatePolicyAssignmentWithOverrides.json */ /** * Sample code: Update a policy assignment with overrides. @@ -90,9 +85,26 @@ public final class PolicyAssignmentsUpdateSamples { } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/updatePolicyAssignmentWithIdentity.json + * x-ms-original-file: 2025-11-01/updatePolicyAssignmentWithSelfserveExemptionSettings.json + */ + /** + * Sample code: Update a policy assignment with self-serve exemption settings. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateAPolicyAssignmentWithSelfServeExemptionSettings( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.policyClient() + .getPolicyAssignments() + .updateWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2", "CostManagement", + new PolicyAssignmentUpdate() + .withSelfServeExemptionSettings(new SelfServeExemptionSettings().withEnabled(true) + .withPolicyDefinitionReferenceIds(Arrays.asList("Limit_Skus"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-11-01/updatePolicyAssignmentWithIdentity.json */ /** * Sample code: Update a policy assignment with a system assigned identity. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java index c5868519a8d7..d12f45ea7a4a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -19,9 +19,7 @@ */ public final class PolicyDefinitionVersionsCreateOrUpdateAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinitionVersionAtManagementGroup.json */ /** * Sample code: Create or update a policy definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateSamples.java index 7769eca26993..0473e5cb6e78 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -19,9 +19,7 @@ */ public final class PolicyDefinitionVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinitionVersion.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinitionVersion.json */ /** * Sample code: Create or update a policy definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteAtManagementGroupSamples.java index bf4afd7573ca..e9589517396a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsDeleteAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/deletePolicyDefinitionVersionAtManagementGroup.json */ /** * Sample code: Delete a policy definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteSamples.java index 008f79610c7c..a490eb29a53a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsDeleteSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyDefinitionVersion.json + * x-ms-original-file: 2025-11-01/deletePolicyDefinitionVersion.json */ /** * Sample code: Delete a policy definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetAtManagementGroupSamples.java index af936448c34b..efefb6ba2650 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsGetAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/getPolicyDefinitionVersionAtManagementGroup.json */ /** * Sample code: Retrieve a policy definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetBuiltInSamples.java index 8734f35f76ea..1451c1bc1959 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsGetBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getBuiltinPolicyDefinitionVersion.json + * x-ms-original-file: 2025-11-01/getBuiltinPolicyDefinitionVersion.json */ /** * Sample code: Retrieve a built-in policy definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetSamples.java index 1dfd59e1d043..cac3ef1d2f6a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsGetSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyDefinitionVersion.json + * x-ms-original-file: 2025-11-01/getPolicyDefinitionVersion.json */ /** * Sample code: Retrieve a policy definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllAtManagementGroupSamples.java index f66f99b75f7e..a7cb5b09ee5a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListAllAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllPolicyDefinitionVersionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listAllPolicyDefinitionVersionsByManagementGroup.json */ /** * Sample code: List all policy definition versions at management group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllBuiltinsSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllBuiltinsSamples.java index 754d931f40de..0b0faffd4cb5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllBuiltinsSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllBuiltinsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListAllBuiltinsSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllBuiltInPolicyDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listAllBuiltInPolicyDefinitionVersions.json */ /** * Sample code: List all built-in policy definition versions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllSamples.java index 99071691d277..a8df310d85a1 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListAllSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListAllSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllPolicyDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listAllPolicyDefinitionVersions.json */ /** * Sample code: List all policy definition versions at subscription. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListBuiltInSamples.java index cdcd155dd953..57289fd5232a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listBuiltInPolicyDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listBuiltInPolicyDefinitionVersions.json */ /** * Sample code: List built-in policy definition versions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListByManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListByManagementGroupSamples.java index 58c12209c1b0..3ed9bc6c089a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListByManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListByManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListByManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyDefinitionVersionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listPolicyDefinitionVersionsByManagementGroup.json */ /** * Sample code: List policy definition versions by management group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListSamples.java index ebc8c0c8ca56..3ffd8a71b4ab 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionVersionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionVersionsListSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listPolicyDefinitionVersions.json */ /** * Sample code: List policy definition versions by subscription. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateAtManagementGroupSamples.java index cdfee3427382..001542e3b738 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -19,9 +19,7 @@ */ public final class PolicyDefinitionsCreateOrUpdateAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinitionAtManagementGroup.json */ /** * Sample code: Create or update a policy definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateSamples.java index 3a6dbf3ff4f7..a389dc3132a6 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -22,9 +22,7 @@ */ public final class PolicyDefinitionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinitionAdvancedParams.json */ /** * Sample code: Create or update a policy definition with advanced parameters. @@ -56,9 +54,7 @@ public static void createOrUpdateAPolicyDefinitionWithAdvancedParameters( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinitionExternalEvaluationEnforcementSettings.json */ /** * Sample code: Create or update a policy definition with external evaluation enforcement settings. @@ -90,9 +86,7 @@ public static void createOrUpdateAPolicyDefinitionWithExternalEvaluationEnforcem } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicyDefinition.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicyDefinition.json */ /** * Sample code: Create or update a policy definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteAtManagementGroupSamples.java index c924e45bdc02..e3279b0f1c39 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsDeleteAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/deletePolicyDefinitionAtManagementGroup.json */ /** * Sample code: Delete a policy definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteSamples.java index 9881eb0799c7..9cccffc3be31 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsDeleteSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicyDefinition.json + * x-ms-original-file: 2025-11-01/deletePolicyDefinition.json */ /** * Sample code: Delete a policy definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetAtManagementGroupSamples.java index 282095dc4ffa..670530119d8a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsGetAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/getPolicyDefinitionAtManagementGroup.json */ /** * Sample code: Retrieve a policy definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetBuiltInSamples.java index a95a8e47dc59..1d72e3d78d89 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsGetBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getBuiltinPolicyDefinition.json + * x-ms-original-file: 2025-11-01/getBuiltinPolicyDefinition.json */ /** * Sample code: Retrieve a built-in policy definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetSamples.java index 0680f9d9473a..b0aab433e1f2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsGetSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicyDefinition.json + * x-ms-original-file: 2025-11-01/getPolicyDefinition.json */ /** * Sample code: Retrieve a policy definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListBuiltInSamples.java index 99c260237142..3edf433ba568 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsListBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listBuiltInPolicyDefinitions.json + * x-ms-original-file: 2025-11-01/listBuiltInPolicyDefinitions.json */ /** * Sample code: List built-in policy definitions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListByManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListByManagementGroupSamples.java index 89642e30a634..7e4a3f6a7154 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListByManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListByManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsListByManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyDefinitionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listPolicyDefinitionsByManagementGroup.json */ /** * Sample code: List policy definitions by management group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListSamples.java index 45b9fbe0223c..4da1e1d1739a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyDefinitionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicyDefinitionsListSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicyDefinitions.json + * x-ms-original-file: 2025-11-01/listPolicyDefinitions.json */ /** * Sample code: List policy definitions by subscription. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsCreateOrUpdateSamples.java deleted file mode 100644 index a95063e490da..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsCreateOrUpdateSamples.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.resources.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.resources.fluent.models.PolicyExemptionInner; -import com.azure.resourcemanager.resources.models.AssignmentScopeValidation; -import com.azure.resourcemanager.resources.models.ExemptionCategory; -import com.azure.resourcemanager.resources.models.ResourceSelector; -import com.azure.resourcemanager.resources.models.Selector; -import com.azure.resourcemanager.resources.models.SelectorKind; -import java.io.IOException; -import java.util.Arrays; - -/** - * Samples for PolicyExemptions CreateOrUpdate. - */ -public final class PolicyExemptionsCreateOrUpdateSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/createOrUpdatePolicyExemption.json - */ - /** - * Sample code: Create or update a policy exemption. - * - * @param manager Entry point to ResourceManager. - */ - public static void createOrUpdateAPolicyExemption(com.azure.resourcemanager.resources.ResourceManager manager) - throws IOException { - manager.policyClient() - .getPolicyExemptions() - .createOrUpdateWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", - new PolicyExemptionInner().withPolicyAssignmentId( - "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement") - .withPolicyDefinitionReferenceIds(Arrays.asList("Limit_Skus")) - .withExemptionCategory(ExemptionCategory.WAIVER) - .withDisplayName("Exempt demo cluster") - .withDescription("Exempt demo cluster from limit sku") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"reason\":\"Temporary exemption for a expensive VM demo\"}", Object.class, - SerializerEncoding.JSON)), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/createOrUpdatePolicyExemptionWithResourceSelectors.json - */ - /** - * Sample code: Create or update a policy exemption with resource selectors. - * - * @param manager Entry point to ResourceManager. - */ - public static void createOrUpdateAPolicyExemptionWithResourceSelectors( - com.azure.resourcemanager.resources.ResourceManager manager) throws IOException { - manager.policyClient() - .getPolicyExemptions() - .createOrUpdateWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", - new PolicyExemptionInner().withPolicyAssignmentId( - "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement") - .withPolicyDefinitionReferenceIds(Arrays.asList("Limit_Skus")) - .withExemptionCategory(ExemptionCategory.WAIVER) - .withDisplayName("Exempt demo cluster") - .withDescription("Exempt demo cluster from limit sku") - .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"reason\":\"Temporary exemption for a expensive VM demo\"}", Object.class, - SerializerEncoding.JSON)) - .withResourceSelectors(Arrays.asList(new ResourceSelector().withName("SDPRegions") - .withSelectors(Arrays.asList(new Selector().withKind(SelectorKind.RESOURCE_LOCATION) - .withIn(Arrays.asList("eastus2euap", "centraluseuap")))))) - .withAssignmentScopeValidation(AssignmentScopeValidation.DEFAULT), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsDeleteSamples.java deleted file mode 100644 index 5952073b2ae9..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsDeleteSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions Delete. - */ -public final class PolicyExemptionsDeleteSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/deletePolicyExemption.json - */ - /** - * Sample code: Delete a policy exemption. - * - * @param manager Entry point to ResourceManager. - */ - public static void deleteAPolicyExemption(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .deleteWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsGetSamples.java deleted file mode 100644 index 532b83b188de..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsGetSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions Get. - */ -public final class PolicyExemptionsGetSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/getPolicyExemptionWithResourceSelectors.json - */ - /** - * Sample code: Retrieve a policy exemption with resource selectors. - * - * @param manager Entry point to ResourceManager. - */ - public static void - retrieveAPolicyExemptionWithResourceSelectors(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/getPolicyExemption.json - */ - /** - * Sample code: Retrieve a policy exemption. - * - * @param manager Entry point to ResourceManager. - */ - public static void retrieveAPolicyExemption(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .getWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListByResourceGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListByResourceGroupSamples.java deleted file mode 100644 index 93c9b91c7c7e..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListByResourceGroupSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions ListByResourceGroup. - */ -public final class PolicyExemptionsListByResourceGroupSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/listPolicyExemptionsForResourceGroup.json - */ - /** - * Sample code: List policy exemptions that apply to a resource group. - * - * @param manager Entry point to ResourceManager. - */ - public static void - listPolicyExemptionsThatApplyToAResourceGroup(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .listByResourceGroup("TestResourceGroup", "atScope()", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForManagementGroupSamples.java deleted file mode 100644 index 541d9d5be3e2..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForManagementGroupSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions ListForManagementGroup. - */ -public final class PolicyExemptionsListForManagementGroupSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/listPolicyExemptionsForManagementGroup.json - */ - /** - * Sample code: List policy exemptions that apply to a management group. - * - * @param manager Entry point to ResourceManager. - */ - public static void - listPolicyExemptionsThatApplyToAManagementGroup(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .listForManagementGroup("DevOrg", "atScope()", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForResourceSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForResourceSamples.java deleted file mode 100644 index 336fa31b283e..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListForResourceSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions ListForResource. - */ -public final class PolicyExemptionsListForResourceSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/listPolicyExemptionsForResource.json - */ - /** - * Sample code: List all policy exemptions that apply to a resource. - * - * @param manager Entry point to ResourceManager. - */ - public static void - listAllPolicyExemptionsThatApplyToAResource(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .listForResource("TestResourceGroup", "Microsoft.Compute", "virtualMachines/MyTestVm", "domainNames", - "MyTestComputer.cloudapp.net", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListSamples.java deleted file mode 100644 index 89237cb7452f..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsListSamples.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.resources.generated; - -/** - * Samples for PolicyExemptions List. - */ -public final class PolicyExemptionsListSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/listPolicyExemptionsForSubscription.json - */ - /** - * Sample code: List policy exemptions that apply to a subscription. - * - * @param manager Entry point to ResourceManager. - */ - public static void - listPolicyExemptionsThatApplyToASubscription(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient().getPolicyExemptions().list("atScope()", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsUpdateSamples.java deleted file mode 100644 index 79a63f745673..000000000000 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyExemptionsUpdateSamples.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.resources.generated; - -import com.azure.resourcemanager.resources.models.AssignmentScopeValidation; -import com.azure.resourcemanager.resources.models.PolicyExemptionUpdate; -import com.azure.resourcemanager.resources.models.ResourceSelector; -import com.azure.resourcemanager.resources.models.Selector; -import com.azure.resourcemanager.resources.models.SelectorKind; -import java.util.Arrays; - -/** - * Samples for PolicyExemptions Update. - */ -public final class PolicyExemptionsUpdateSamples { - /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * preview/2022-07-01-preview/examples/updatePolicyExemptionWithResourceSelectors.json - */ - /** - * Sample code: Update a policy exemption with resource selectors. - * - * @param manager Entry point to ResourceManager. - */ - public static void - updateAPolicyExemptionWithResourceSelectors(com.azure.resourcemanager.resources.ResourceManager manager) { - manager.policyClient() - .getPolicyExemptions() - .updateWithResponse("subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster", - "DemoExpensiveVM", - new PolicyExemptionUpdate() - .withResourceSelectors(Arrays.asList(new ResourceSelector().withName("SDPRegions") - .withSelectors(Arrays.asList(new Selector().withKind(SelectorKind.RESOURCE_LOCATION) - .withIn(Arrays.asList("eastus2euap", "centraluseuap")))))) - .withAssignmentScopeValidation(AssignmentScopeValidation.DEFAULT), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java index 20d4d09ebd90..b83176381c36 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -19,9 +19,7 @@ */ public final class PolicySetDefinitionVersionsCreateOrUpdateAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinitionVersionAtManagementGroup.json */ /** * Sample code: Create or update a policy set definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateSamples.java index f5329c71b91a..973f0d897150 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -22,9 +22,7 @@ */ public final class PolicySetDefinitionVersionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionVersion.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinitionVersion.json */ /** * Sample code: Create or update a policy set definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteAtManagementGroupSamples.java index 978882363958..f23de24b69cb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsDeleteAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicySetDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/deletePolicySetDefinitionVersionAtManagementGroup.json */ /** * Sample code: Delete a policy set definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteSamples.java index 99b084405371..933175511baf 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsDeleteSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicySetDefinitionVersion.json + * x-ms-original-file: 2025-11-01/deletePolicySetDefinitionVersion.json */ /** * Sample code: Delete a policy set definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetAtManagementGroupSamples.java index a24624564335..965ad02ddc93 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsGetAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicySetDefinitionVersionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/getPolicySetDefinitionVersionAtManagementGroup.json */ /** * Sample code: Retrieve a policy set definition version at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetBuiltInSamples.java index 4e6d35c983fc..add76da99ffd 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsGetBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getBuiltInPolicySetDefinitionVersion.json + * x-ms-original-file: 2025-11-01/getBuiltInPolicySetDefinitionVersion.json */ /** * Sample code: Retrieve a built-in policy set definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetSamples.java index d602cde35b7a..643457da8c7d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsGetSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicySetDefinitionVersion.json + * x-ms-original-file: 2025-11-01/getPolicySetDefinitionVersion.json */ /** * Sample code: Retrieve a policy set definition version. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllAtManagementGroupSamples.java index c7ad2c245634..682c78e21283 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListAllAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllPolicySetDefinitionVersionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listAllPolicySetDefinitionVersionsByManagementGroup.json */ /** * Sample code: List all policy definition versions at management group. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllBuiltinsSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllBuiltinsSamples.java index 306937c8ae54..085c3eb2b9eb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllBuiltinsSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllBuiltinsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListAllBuiltinsSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllBuiltInPolicySetDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listAllBuiltInPolicySetDefinitionVersions.json */ /** * Sample code: List all built-in policy definition versions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllSamples.java index 732812e15bcf..66cdf088f5b0 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListAllSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListAllSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listAllPolicySetDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listAllPolicySetDefinitionVersions.json */ /** * Sample code: List all policy definition versions at subscription. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListBuiltInSamples.java index 2fb83acf9b06..cf6d38b0f77a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listBuiltInPolicySetDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listBuiltInPolicySetDefinitionVersions.json */ /** * Sample code: List built-in policy set definitions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListByManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListByManagementGroupSamples.java index 955e09904038..2fa8e50d819e 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListByManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListByManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListByManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicySetDefinitionVersionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listPolicySetDefinitionVersionsByManagementGroup.json */ /** * Sample code: List policy set definitions at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListSamples.java index cf683430749d..0db4e237a665 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionVersionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionVersionsListSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicySetDefinitionVersions.json + * x-ms-original-file: 2025-11-01/listPolicySetDefinitionVersions.json */ /** * Sample code: List policy set definitions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateAtManagementGroupSamples.java index a074f3b91d6e..0d3bed1970cc 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -20,9 +20,7 @@ */ public final class PolicySetDefinitionsCreateOrUpdateAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinitionWithGroupsAtManagementGroup.json */ /** * Sample code: Create or update a policy set definition with groups at management group level. @@ -65,9 +63,7 @@ public static void createOrUpdateAPolicySetDefinitionWithGroupsAtManagementGroup } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinitionAtManagementGroup.json */ /** * Sample code: Create or update a policy set definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateSamples.java index 12e10587c4e1..674cb661908a 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -23,9 +23,7 @@ */ public final class PolicySetDefinitionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinitionWithGroups.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinitionWithGroups.json */ /** * Sample code: Create or update a policy set definition with groups. @@ -68,9 +66,7 @@ public static void createOrUpdateAPolicySetDefinitionWithGroups( } /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/createOrUpdatePolicySetDefinition.json + * x-ms-original-file: 2025-11-01/createOrUpdatePolicySetDefinition.json */ /** * Sample code: Create or update a policy set definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteAtManagementGroupSamples.java index b4d47a7ba3a4..944eec10fb0b 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsDeleteAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicySetDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/deletePolicySetDefinitionAtManagementGroup.json */ /** * Sample code: Delete a policy set definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteSamples.java index 3772d12c57d0..eae74a5aff5d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsDeleteSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/deletePolicySetDefinition.json + * x-ms-original-file: 2025-11-01/deletePolicySetDefinition.json */ /** * Sample code: Delete a policy set definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetAtManagementGroupSamples.java index 09f06a433e64..bf338ac6c65d 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsGetAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicySetDefinitionAtManagementGroup.json + * x-ms-original-file: 2025-11-01/getPolicySetDefinitionAtManagementGroup.json */ /** * Sample code: Retrieve a policy set definition at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetBuiltInSamples.java index f863ba673010..c36c1ff622c7 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsGetBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getBuiltInPolicySetDefinition.json + * x-ms-original-file: 2025-11-01/getBuiltInPolicySetDefinition.json */ /** * Sample code: Retrieve a built-in policy set definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetSamples.java index ef6e62c105e0..8a9e1df6f3d9 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsGetSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/getPolicySetDefinition.json + * x-ms-original-file: 2025-11-01/getPolicySetDefinition.json */ /** * Sample code: Retrieve a policy set definition. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListBuiltInSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListBuiltInSamples.java index 0debd71c273e..b1c093a71b39 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListBuiltInSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListBuiltInSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsListBuiltInSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listBuiltInPolicySetDefinitions.json + * x-ms-original-file: 2025-11-01/listBuiltInPolicySetDefinitions.json */ /** * Sample code: List built-in policy set definitions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListByManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListByManagementGroupSamples.java index b4d648a432db..76c98b4c6367 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListByManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListByManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsListByManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicySetDefinitionsByManagementGroup.json + * x-ms-original-file: 2025-11-01/listPolicySetDefinitionsByManagementGroup.json */ /** * Sample code: List policy set definitions at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListSamples.java index c3d6d7477a18..04b1055b5aeb 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicySetDefinitionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -9,9 +9,7 @@ */ public final class PolicySetDefinitionsListSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/listPolicySetDefinitions.json + * x-ms-original-file: 2025-11-01/listPolicySetDefinitions.json */ /** * Sample code: List policy set definitions. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireAtManagementGroupSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireAtManagementGroupSamples.java index 603d49812f5d..984ee80512a5 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireAtManagementGroupSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireAtManagementGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -12,9 +12,7 @@ */ public final class PolicyTokensAcquireAtManagementGroupSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/acquirePolicyTokenAtManagementGroup.json + * x-ms-original-file: 2025-11-01/acquirePolicyTokenAtManagementGroup.json */ /** * Sample code: Acquire a policy token at management group level. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireSamples.java index 697cbd3d004b..de0badd593d2 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireSamples.java +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/PolicyTokensAcquireSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.resources.generated; @@ -12,9 +12,7 @@ */ public final class PolicyTokensAcquireSamples { /* - * x-ms-original-file: - * 2b3c430bff9474d80080498090d71caf3fafcb75/specification/resources/resource-manager/Microsoft.Authorization/policy/ - * stable/2025-03-01/examples/acquirePolicyToken.json + * x-ms-original-file: 2025-11-01/acquirePolicyToken.json */ /** * Sample code: Acquire a policy token. diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProviderResourceTypesListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProviderResourceTypesListSamples.java new file mode 100644 index 000000000000..52d6c154383e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProviderResourceTypesListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ProviderResourceTypes List. + */ +public final class ProviderResourceTypesListSamples { + /* + * x-ms-original-file: 2025-04-01/GetProviderResourceTypes.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getProviderResourceTypes() + .listWithResponse("Microsoft.TestRP", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetAtTenantScopeSamples.java new file mode 100644 index 000000000000..971f16e70d44 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetAtTenantScopeSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Providers GetAtTenantScope. + */ +public final class ProvidersGetAtTenantScopeSamples { + /* + * x-ms-original-file: 2025-04-01/GetNamedProviderAtTenant.json + */ + /** + * Sample code: Get a resource provider at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void getAResourceProviderAtTenantScope(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getProviders() + .getAtTenantScopeWithResponse("Microsoft.Storage", "resourceTypes/aliases", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetSamples.java new file mode 100644 index 000000000000..fc25b7fd25ea --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Providers Get. + */ +public final class ProvidersGetSamples { + /* + * x-ms-original-file: 2025-04-01/GetProvider.json + */ + /** + * Sample code: Get provider. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProvider(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getProviders() + .getWithResponse("Microsoft.TestRP1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersListSamples.java new file mode 100644 index 000000000000..73811bd1fdb3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Providers List. + */ +public final class ProvidersListSamples { + /* + * x-ms-original-file: 2025-04-01/GetProviders.json + */ + /** + * Sample code: Get providers. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviders(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient().getProviders().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersProviderPermissionsSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersProviderPermissionsSamples.java new file mode 100644 index 000000000000..363fcc78f3ab --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ProvidersProviderPermissionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Providers ProviderPermissions. + */ +public final class ProvidersProviderPermissionsSamples { + /* + * x-ms-original-file: 2025-04-01/GetProviderPermissions.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getProviders() + .providerPermissionsWithResponse("Microsoft.TestRP", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..341325d738c4 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.ResourceGroupInner; + +/** + * Samples for ResourceGroups CreateOrUpdate. + */ +public final class ResourceGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-04-01/CreateResourceGroup.json + */ + /** + * Sample code: Create or update a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void createOrUpdateAResourceGroup(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .createOrUpdateWithResponse("my-resource-group", new ResourceGroupInner().withLocation("eastus"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsDeleteSamples.java new file mode 100644 index 000000000000..64a28cabb843 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsDeleteSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for ResourceGroups Delete. + */ +public final class ResourceGroupsDeleteSamples { + /* + * x-ms-original-file: 2025-04-01/ForceDeleteVMsInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void + forceDeleteAllTheVirtualMachinesInAResourceGroup(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .delete("my-resource-group", "Microsoft.Compute/virtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/ForceDeleteVMsAndVMSSInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines and Virtual Machine Scale Sets in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup( + com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .delete("my-resource-group", "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsExportTemplateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsExportTemplateSamples.java new file mode 100644 index 000000000000..eefbc8a7d4dc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceGroupsExportTemplateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.ExportTemplateOutputFormat; +import com.azure.resourcemanager.resources.models.ExportTemplateRequest; +import java.util.Arrays; + +/** + * Samples for ResourceGroups ExportTemplate. + */ +public final class ResourceGroupsExportTemplateSamples { + /* + * x-ms-original-file: 2025-04-01/ExportResourceGroupAsBicep.json + */ + /** + * Sample code: Export a resource group as Bicep. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroupAsBicep(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .exportTemplate("my-resource-group", + new ExportTemplateRequest().withResources(Arrays.asList("*")) + .withOptions("IncludeParameterDefaultValue,IncludeComments") + .withOutputFormat(ExportTemplateOutputFormat.BICEP), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/ExportResourceGroup.json + */ + /** + * Sample code: Export a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroup(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .exportTemplate("my-resource-group", new ExportTemplateRequest().withResources(Arrays.asList("*")) + .withOptions("IncludeParameterDefaultValue,IncludeComments"), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/ExportResourceGroupWithFiltering.json + */ + /** + * Sample code: Export a resource group with filtering. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroupWithFiltering(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getResourceGroups() + .exportTemplate("my-resource-group", new ExportTemplateRequest().withResources(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource")) + .withOptions("SkipResourceNameParameterization"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceNamesCheckResourceNameSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceNamesCheckResourceNameSamples.java new file mode 100644 index 000000000000..ea224b01e65b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/ResourceNamesCheckResourceNameSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.ResourceName; + +/** + * Samples for ResourceNames CheckResourceName. + */ +public final class ResourceNamesCheckResourceNameSamples { + /* + * x-ms-original-file: 2022-12-01/CheckResourceName.json + */ + /** + * Sample code: CheckValidityForAResourceName. + * + * @param manager Entry point to ResourceManager. + */ + public static void checkValidityForAResourceName(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient() + .getResourceNames() + .checkResourceNameWithResponse( + new ResourceName().withName("isxbox").withType("ResourceProviderTestHost/TestResourceType"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b9219bd8ae5c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.SubscriptionFeatureRegistrationInner; +import com.azure.resourcemanager.resources.models.SubscriptionFeatureRegistrationProperties; + +/** + * Samples for SubscriptionFeatureRegistrations CreateOrUpdate. + */ +public final class SubscriptionFeatureRegistrationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * FeatureRegistration/SubscriptionFeatureRegistrationPUT.json + */ + /** + * Sample code: Creates a feature registration. + * + * @param manager Entry point to ResourceManager. + */ + public static void createsAFeatureRegistration(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getSubscriptionFeatureRegistrations() + .createOrUpdateWithResponse("subscriptionFeatureRegistrationGroupTestRG", "testFeature", + new SubscriptionFeatureRegistrationInner() + .withProperties(new SubscriptionFeatureRegistrationProperties()), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsDeleteSamples.java new file mode 100644 index 000000000000..aea3526c6b36 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsDeleteSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for SubscriptionFeatureRegistrations Delete. + */ +public final class SubscriptionFeatureRegistrationsDeleteSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * FeatureRegistration/SubscriptionFeatureRegistrationDELETE.json + */ + /** + * Sample code: Deletes a feature registration. + * + * @param manager Entry point to ResourceManager. + */ + public static void deletesAFeatureRegistration(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getSubscriptionFeatureRegistrations() + .deleteWithResponse("subscriptionFeatureRegistrationGroupTestRG", "testFeature", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsGetSamples.java new file mode 100644 index 000000000000..b7bbc5ce82cc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for SubscriptionFeatureRegistrations Get. + */ +public final class SubscriptionFeatureRegistrationsGetSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * FeatureRegistration/SubscriptionFeatureRegistrationGET.json + */ + /** + * Sample code: Gets a feature registration. + * + * @param manager Entry point to ResourceManager. + */ + public static void getsAFeatureRegistration(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getSubscriptionFeatureRegistrations() + .getWithResponse("subscriptionFeatureRegistrationGroupTestRG", "testFeature", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListBySubscriptionSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListBySubscriptionSamples.java new file mode 100644 index 000000000000..d49da4c162e5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListBySubscriptionSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for SubscriptionFeatureRegistrations ListBySubscription. + */ +public final class SubscriptionFeatureRegistrationsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * FeatureRegistration/SubscriptionFeatureRegistrationLIST.json + */ + /** + * Sample code: Gets a list of feature registrations. + * + * @param manager Entry point to ResourceManager. + */ + public static void getsAListOfFeatureRegistrations(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient() + .getSubscriptionFeatureRegistrations() + .listBySubscription("subscriptionFeatureRegistrationGroupTestRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListSamples.java new file mode 100644 index 000000000000..aa20cbdccc09 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionFeatureRegistrationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Generated code + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for SubscriptionFeatureRegistrations List. + */ +public final class SubscriptionFeatureRegistrationsListSamples { + /* + * x-ms-original-file: + * specification/resources/resource-manager/Microsoft.Features/features/stable/2021-07-01/examples/ + * FeatureRegistration/SubscriptionFeatureRegistrationLISTALL.json + */ + /** + * Sample code: Gets a list of feature registrations. + * + * @param manager Entry point to ResourceManager. + */ + public static void getsAListOfFeatureRegistrations(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.featureClient().getSubscriptionFeatureRegistrations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsCheckZonePeersSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsCheckZonePeersSamples.java new file mode 100644 index 000000000000..3c4c8bdde581 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsCheckZonePeersSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.CheckZonePeersRequest; +import java.util.Arrays; + +/** + * Samples for Subscriptions CheckZonePeers. + */ +public final class SubscriptionsCheckZonePeersSamples { + /* + * x-ms-original-file: 2022-12-01/PostCheckZonePeers.json + */ + /** + * Sample code: GetLogicalZoneMapping. + * + * @param manager Entry point to ResourceManager. + */ + public static void getLogicalZoneMapping(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient() + .getSubscriptions() + .checkZonePeersWithResponse("8d65815f-a5b6-402f-9298-045155da7d74", + new CheckZonePeersRequest().withLocation("eastus") + .withSubscriptionIds(Arrays.asList("subscriptions/11111111-1111-1111-1111-111111111111")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsGetSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsGetSamples.java new file mode 100644 index 000000000000..d1f288087618 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Subscriptions Get. + */ +public final class SubscriptionsGetSamples { + /* + * x-ms-original-file: 2022-12-01/GetSubscription.json + */ + /** + * Sample code: GetASingleSubscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void getASingleSubscription(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient() + .getSubscriptions() + .getWithResponse("291bba3f-e0a5-47bc-a099-3bdcb2a50a05", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListLocationsSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListLocationsSamples.java new file mode 100644 index 000000000000..c93ec1e0a699 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListLocationsSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Subscriptions ListLocations. + */ +public final class SubscriptionsListLocationsSamples { + /* + * x-ms-original-file: 2022-12-01/GetLocationsWithExtendedLocations.json + */ + /** + * Sample code: GetLocationsWithExtendedLocations. + * + * @param manager Entry point to ResourceManager. + */ + public static void getLocationsWithExtendedLocations(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient() + .getSubscriptions() + .listLocations("a1ffc958-d2c7-493e-9f1e-125a0477f536", true, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-12-01/GetLocations.json + */ + /** + * Sample code: GetLocationsWithASubscriptionId. + * + * @param manager Entry point to ResourceManager. + */ + public static void getLocationsWithASubscriptionId(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient() + .getSubscriptions() + .listLocations("a1ffc958-d2c7-493e-9f1e-125a0477f536", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListSamples.java new file mode 100644 index 000000000000..10970aa2d90e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/SubscriptionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Subscriptions List. + */ +public final class SubscriptionsListSamples { + /* + * x-ms-original-file: 2022-12-01/GetSubscriptions.json + */ + /** + * Sample code: GetAllSubscriptions. + * + * @param manager Entry point to ResourceManager. + */ + public static void getAllSubscriptions(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient().getSubscriptions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsCreateOrUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsCreateOrUpdateAtScopeSamples.java new file mode 100644 index 000000000000..d000bfac3ddb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsCreateOrUpdateAtScopeSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.models.Tags; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for TagOperations CreateOrUpdateAtScope. + */ +public final class TagOperationsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PutTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .createOrUpdateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsResourceInner().withProperties( + new Tags().withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PutTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .createOrUpdateAtScope("subscriptions/00000000-0000-0000-0000-000000000000", + new TagsResourceInner().withProperties( + new Tags().withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsDeleteAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsDeleteAtScopeSamples.java new file mode 100644 index 000000000000..1e7093f13745 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsDeleteAtScopeSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for TagOperations DeleteAtScope. + */ +public final class TagOperationsDeleteAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/DeleteTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .deleteAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/DeleteTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .deleteAtScope("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsGetAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsGetAtScopeSamples.java new file mode 100644 index 000000000000..0764034be73b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsGetAtScopeSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for TagOperations GetAtScope. + */ +public final class TagOperationsGetAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/GetTagsResource.json + */ + /** + * Sample code: Get tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnAResource(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .getAtScopeWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/GetTagsSubscription.json + */ + /** + * Sample code: Get tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnASubscription(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .getAtScopeWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsUpdateAtScopeSamples.java new file mode 100644 index 000000000000..bd40558e8225 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TagOperationsUpdateAtScopeSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +import com.azure.resourcemanager.resources.models.Tags; +import com.azure.resourcemanager.resources.models.TagsPatchOperation; +import com.azure.resourcemanager.resources.models.TagsPatchResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for TagOperations UpdateAtScope. + */ +public final class TagOperationsUpdateAtScopeSamples { + /* + * x-ms-original-file: 2025-04-01/PatchTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .updateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsPatchResource().withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags() + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-04-01/PatchTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.serviceClient() + .getTagOperations() + .updateAtScope("subscriptions/00000000-0000-0000-0000-000000000000", + new TagsPatchResource().withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags() + .withTags(mapOf("tagKey1", "fakeTokenPlaceholder", "tagKey2", "fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TenantsListSamples.java b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TenantsListSamples.java new file mode 100644 index 000000000000..9bb776c36047 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/src/samples/java/com/azure/resourcemanager/resources/generated/TenantsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.resources.generated; + +/** + * Samples for Tenants List. + */ +public final class TenantsListSamples { + /* + * x-ms-original-file: 2022-12-01/GetTenants.json + */ + /** + * Sample code: GetAllTenants. + * + * @param manager Entry point to ResourceManager. + */ + public static void getAllTenants(com.azure.resourcemanager.resources.ResourceManager manager) { + manager.subscriptionClient().getTenants().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java b/sdk/resources/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java index 9d9f49f120dc..32289924f682 100644 --- a/sdk/resources/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java +++ b/sdk/resources/azure-resourcemanager-resources/src/test/java/com/azure/resourcemanager/resources/FeaturesTests.java @@ -3,6 +3,7 @@ package com.azure.resourcemanager.resources; +import com.azure.core.test.annotation.DoNotRecord; import com.azure.resourcemanager.resources.models.Feature; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -12,6 +13,8 @@ public class FeaturesTests extends ResourceManagementTest { + // Feature availability and registration state are subscription-specific. + @DoNotRecord(skipInPlayback = true) @Test public void canListAndRegisterFeature() { List features = resourceClient.features().list().stream().collect(Collectors.toList()); diff --git a/sdk/resources/azure-resourcemanager-resources/tsp-location.yaml b/sdk/resources/azure-resourcemanager-resources/tsp-location.yaml new file mode 100644 index 000000000000..695eeaef8590 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/resources/resource-manager/Microsoft.Resources/resources +commit: 8e1ccf713f549ade0d4bdf53f022585aa04fc723 +repo: Azure/azure-rest-api-specs +additionalDirectories: