From 31f957c5936d44931009617354079f4bc1ef5b95 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 24 Dec 2025 01:15:07 +0000 Subject: [PATCH] Configurations: 'specification/cdn/resource-manager/Microsoft.Cdn/EdgeActions/tspconfig.yaml', API Version: 2025-09-01-preview, SDK Release Type: beta, and CommitSHA: 'be46becafeb29aa993898709e35759d3643b2809' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5699253 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 ++ .../SAMPLE.md | 552 ++++++ .../azure-resourcemanager-edgeactions/pom.xml | 74 + .../edgeactions/EdgeActionsManager.java | 314 ++++ .../EdgeActionExecutionFiltersClient.java | 277 +++ .../fluent/EdgeActionVersionsClient.java | 456 +++++ .../edgeactions/fluent/EdgeActionsClient.java | 393 +++++ .../fluent/EdgeActionsManagementClient.java | 69 + .../EdgeActionAttachmentResponseInner.java | 76 + .../EdgeActionExecutionFilterInner.java | 183 ++ .../fluent/models/EdgeActionInner.java | 210 +++ .../fluent/models/EdgeActionVersionInner.java | 180 ++ .../EdgeActionVersionPropertiesInner.java | 176 ++ .../fluent/models/VersionCodeInner.java | 114 ++ .../fluent/models/package-info.java | 8 + .../edgeactions/fluent/package-info.java | 8 + .../EdgeActionAttachmentResponseImpl.java | 32 + .../EdgeActionExecutionFilterImpl.java | 170 ++ .../EdgeActionExecutionFiltersClientImpl.java | 1004 +++++++++++ .../EdgeActionExecutionFiltersImpl.java | 160 ++ .../implementation/EdgeActionImpl.java | 192 ++ .../implementation/EdgeActionVersionImpl.java | 202 +++ .../EdgeActionVersionPropertiesImpl.java | 53 + .../EdgeActionVersionsClientImpl.java | 1571 +++++++++++++++++ .../EdgeActionVersionsImpl.java | 213 +++ .../implementation/EdgeActionsClientImpl.java | 1497 ++++++++++++++++ .../implementation/EdgeActionsImpl.java | 180 ++ .../EdgeActionsManagementClientBuilder.java | 138 ++ .../EdgeActionsManagementClientImpl.java | 340 ++++ .../implementation/ResourceManagerUtils.java | 195 ++ .../implementation/VersionCodeImpl.java | 36 + .../EdgeActionExecutionFilterListResult.java | 98 + .../models/EdgeActionListResult.java | 95 + .../models/EdgeActionVersionListResult.java | 96 + .../implementation/package-info.java | 8 + .../edgeactions/models/EdgeAction.java | 342 ++++ .../models/EdgeActionAttachment.java | 102 ++ .../models/EdgeActionAttachmentResponse.java | 26 + .../models/EdgeActionExecutionFilter.java | 266 +++ .../EdgeActionExecutionFilterProperties.java | 184 ++ .../models/EdgeActionExecutionFilters.java | 147 ++ .../models/EdgeActionIsDefaultVersion.java | 51 + .../models/EdgeActionProperties.java | 94 + .../edgeactions/models/EdgeActionVersion.java | 329 ++++ .../EdgeActionVersionDeploymentType.java | 56 + .../models/EdgeActionVersionProperties.java | 55 + .../EdgeActionVersionValidationStatus.java | 51 + .../models/EdgeActionVersions.java | 228 +++ .../edgeactions/models/EdgeActions.java | 212 +++ .../edgeactions/models/ProvisioningState.java | 66 + .../edgeactions/models/SkuType.java | 114 ++ .../edgeactions/models/VersionCode.java | 33 + .../edgeactions/models/package-info.java | 8 + .../edgeactions/package-info.java | 8 + .../src/main/java/module-info.java | 16 + ...anager-edgeactions_apiview_properties.json | 65 + ...-resourcemanager-edgeactions_metadata.json | 1 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ure-resourcemanager-edgeactions.properties | 1 + ...geActionExecutionFiltersCreateSamples.java | 33 + ...geActionExecutionFiltersDeleteSamples.java | 24 + .../EdgeActionExecutionFiltersGetSamples.java | 23 + ...ecutionFiltersListByEdgeActionSamples.java | 24 + ...geActionExecutionFiltersUpdateSamples.java | 32 + .../EdgeActionVersionsCreateSamples.java | 33 + .../EdgeActionVersionsDeleteSamples.java | 22 + ...ctionVersionsDeployVersionCodeSamples.java | 27 + .../EdgeActionVersionsGetSamples.java | 23 + ...geActionVersionsGetVersionCodeSamples.java | 23 + ...ActionVersionsListByEdgeActionSamples.java | 23 + .../EdgeActionVersionsSwapDefaultSamples.java | 22 + .../EdgeActionVersionsUpdateSamples.java | 32 + .../EdgeActionsAddAttachmentSamples.java | 27 + .../generated/EdgeActionsCreateSamples.java | 29 + .../EdgeActionsDeleteAttachmentSamples.java | 27 + .../generated/EdgeActionsDeleteSamples.java | 22 + .../EdgeActionsGetByResourceGroupSamples.java | 22 + ...EdgeActionsListByResourceGroupSamples.java | 23 + .../generated/EdgeActionsListSamples.java | 22 + .../generated/EdgeActionsUpdateSamples.java | 28 + ...dgeActionAttachmentResponseInnerTests.java | 18 + .../generated/EdgeActionAttachmentTests.java | 26 + .../EdgeActionExecutionFilterInnerTests.java | 53 + ...eActionExecutionFilterListResultTests.java | 24 + ...eActionExecutionFilterPropertiesTests.java | 33 + ...ActionExecutionFiltersCreateMockTests.java | 64 + ...cutionFiltersGetWithResponseMockTests.java | 43 + ...utionFiltersListByEdgeActionMockTests.java | 44 + .../generated/EdgeActionInnerTests.java | 51 + .../generated/EdgeActionListResultTests.java | 23 + .../generated/EdgeActionPropertiesTests.java | 23 + .../EdgeActionVersionInnerTests.java | 53 + .../EdgeActionVersionListResultTests.java | 26 + ...EdgeActionVersionPropertiesInnerTests.java | 32 + .../EdgeActionVersionsCreateMockTests.java | 65 + ...ionVersionsDeployVersionCodeMockTests.java | 44 + ...ActionVersionsGetVersionCodeMockTests.java | 38 + ...ctionVersionsGetWithResponseMockTests.java | 44 + ...tionVersionsListByEdgeActionMockTests.java | 46 + .../EdgeActionsAddAttachmentMockTests.java | 39 + .../generated/EdgeActionsCreateMockTests.java | 63 + ...tByResourceGroupWithResponseMockTests.java | 42 + ...geActionsListByResourceGroupMockTests.java | 42 + .../generated/EdgeActionsListMockTests.java | 41 + .../edgeactions/generated/SkuTypeTests.java | 27 + .../generated/VersionCodeInnerTests.java | 27 + .../tsp-location.yaml | 4 + sdk/edgeactions/ci.yml | 46 + sdk/edgeactions/pom.xml | 15 + 113 files changed, 13576 insertions(+) create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/CHANGELOG.md create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/README.md create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/SAMPLE.md create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/EdgeActionsManager.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionExecutionFiltersClient.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsClient.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsManagementClient.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionAttachmentResponseInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionExecutionFilterInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionPropertiesInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/VersionCodeInner.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/package-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/package-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionAttachmentResponseImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFilterImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersClientImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionPropertiesImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsClientImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientBuilder.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/ResourceManagerUtils.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/VersionCodeImpl.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionExecutionFilterListResult.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionListResult.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionVersionListResult.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/package-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeAction.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachment.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachmentResponse.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilter.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilterProperties.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilters.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionIsDefaultVersion.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionProperties.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionDeploymentType.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionProperties.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionValidationStatus.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActions.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/ProvisioningState.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/SkuType.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/VersionCode.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/package-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/package-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/module-info.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_apiview_properties.json create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_metadata.json create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/proxy-config.json create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/reflect-config.json create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/azure-resourcemanager-edgeactions.properties create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersDeleteSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersUpdateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeleteSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsSwapDefaultSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsUpdateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteAttachmentSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsUpdateSamples.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentResponseInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterListResultTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterPropertiesTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetWithResponseMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionListResultTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionPropertiesTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionListResultTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionPropertiesInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetWithResponseMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListMockTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/SkuTypeTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/VersionCodeInnerTests.java create mode 100644 sdk/edgeactions/azure-resourcemanager-edgeactions/tsp-location.yaml create mode 100644 sdk/edgeactions/ci.yml create mode 100644 sdk/edgeactions/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 62711bd793fc..cdf70dd931df 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -514,6 +514,7 @@ com.azure.resourcemanager:azure-resourcemanager-workloadorchestration;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-disconnectedoperations;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-compute-recommender;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-computelimit;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-edgeactions;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.2;2.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 020e7eae65cd..a484c7608ad3 100644 --- a/pom.xml +++ b/pom.xml @@ -105,6 +105,7 @@ sdk/durabletask sdk/dynatrace sdk/easm + sdk/edgeactions sdk/edgeorder sdk/edgezones sdk/education diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/CHANGELOG.md b/sdk/edgeactions/azure-resourcemanager-edgeactions/CHANGELOG.md new file mode 100644 index 000000000000..d51b753715ef --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-12-24) + +- Azure Resource Manager EdgeActions client library for Java. This package contains Microsoft Azure SDK for EdgeActions Management SDK. Package api-version 2025-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-edgeactions Java SDK. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/README.md b/sdk/edgeactions/azure-resourcemanager-edgeactions/README.md new file mode 100644 index 000000000000..8f966e0dcb13 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager EdgeActions client library for Java + +Azure Resource Manager EdgeActions client library for Java. + +This package contains Microsoft Azure SDK for EdgeActions Management SDK. Package api-version 2025-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-edgeactions;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-edgeactions + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +EdgeActionsManager manager = EdgeActionsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/edgeactions/azure-resourcemanager-edgeactions/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/SAMPLE.md b/sdk/edgeactions/azure-resourcemanager-edgeactions/SAMPLE.md new file mode 100644 index 000000000000..57ec313a1b17 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/SAMPLE.md @@ -0,0 +1,552 @@ +# Code snippets and samples + + +## EdgeActionExecutionFilters + +- [Create](#edgeactionexecutionfilters_create) +- [Delete](#edgeactionexecutionfilters_delete) +- [Get](#edgeactionexecutionfilters_get) +- [ListByEdgeAction](#edgeactionexecutionfilters_listbyedgeaction) +- [Update](#edgeactionexecutionfilters_update) + +## EdgeActionVersions + +- [Create](#edgeactionversions_create) +- [Delete](#edgeactionversions_delete) +- [DeployVersionCode](#edgeactionversions_deployversioncode) +- [Get](#edgeactionversions_get) +- [GetVersionCode](#edgeactionversions_getversioncode) +- [ListByEdgeAction](#edgeactionversions_listbyedgeaction) +- [SwapDefault](#edgeactionversions_swapdefault) +- [Update](#edgeactionversions_update) + +## EdgeActions + +- [AddAttachment](#edgeactions_addattachment) +- [Create](#edgeactions_create) +- [Delete](#edgeactions_delete) +- [DeleteAttachment](#edgeactions_deleteattachment) +- [GetByResourceGroup](#edgeactions_getbyresourcegroup) +- [List](#edgeactions_list) +- [ListByResourceGroup](#edgeactions_listbyresourcegroup) +- [Update](#edgeactions_update) +### EdgeActionExecutionFilters_Create + +```java +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; + +/** + * Samples for EdgeActionExecutionFilters Create. + */ +public final class EdgeActionExecutionFiltersCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Create.json + */ + /** + * Sample code: CreateEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + createEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .define("executionFilter1") + .withRegion("global") + .withExistingEdgeAction("testrg", "edgeAction1") + .withProperties(new EdgeActionExecutionFilterProperties().withVersionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/Microsoft.Cdn/EdgeActions/edgeAction1/versions/version1") + .withExecutionFilterIdentifierHeaderName("header-key") + .withExecutionFilterIdentifierHeaderValue("header-value")) + .create(); + } +} +``` + +### EdgeActionExecutionFilters_Delete + +```java +/** + * Samples for EdgeActionExecutionFilters Delete. + */ +public final class EdgeActionExecutionFiltersDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Delete.json + */ + /** + * Sample code: DeleteEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + deleteEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .delete("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionExecutionFilters_Get + +```java +/** + * Samples for EdgeActionExecutionFilters Get. + */ +public final class EdgeActionExecutionFiltersGetSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Get.json + */ + /** + * Sample code: GetEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .getWithResponse("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionExecutionFilters_ListByEdgeAction + +```java +/** + * Samples for EdgeActionExecutionFilters ListByEdgeAction. + */ +public final class EdgeActionExecutionFiltersListByEdgeActionSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_ListByEdgeAction.json + */ + /** + * Sample code: ListEdgeActionsExecutionFiltersByEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + listEdgeActionsExecutionFiltersByEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .listByEdgeAction("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionExecutionFilters_Update + +```java +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; + +/** + * Samples for EdgeActionExecutionFilters Update. + */ +public final class EdgeActionExecutionFiltersUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Update.json + */ + /** + * Sample code: UpdateEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + updateEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeActionExecutionFilter resource = manager.edgeActionExecutionFilters() + .getWithResponse("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new EdgeActionExecutionFilterProperties().withExecutionFilterIdentifierHeaderValue("header-value2")) + .apply(); + } +} +``` + +### EdgeActionVersions_Create + +```java +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; + +/** + * Samples for EdgeActionVersions Create. + */ +public final class EdgeActionVersionsCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Create.json + */ + /** + * Sample code: CreateEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void createEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .define("version2") + .withRegion("global") + .withExistingEdgeAction("testrg", "edgeAction1") + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.ZIP) + .withIsDefaultVersion(EdgeActionIsDefaultVersion.TRUE)) + .create(); + } +} +``` + +### EdgeActionVersions_Delete + +```java +/** + * Samples for EdgeActionVersions Delete. + */ +public final class EdgeActionVersionsDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Delete.json + */ + /** + * Sample code: DeleteEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().delete("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_DeployVersionCode + +```java +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; + +/** + * Samples for EdgeActionVersions DeployVersionCode. + */ +public final class EdgeActionVersionsDeployVersionCodeSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_DeployVersionCode.json + */ + /** + * Sample code: DeployVersionCode. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deployVersionCode(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .deployVersionCode("testrg", "edgeAction1", "version2", + new VersionCodeInner().withContent("UEsDBBQAAAAIAI1NzkQAAAAABQAAAA==").withName("zippedFile"), + com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_Get + +```java +/** + * Samples for EdgeActionVersions Get. + */ +public final class EdgeActionVersionsGetSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Get.json + */ + /** + * Sample code: GetEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .getWithResponse("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_GetVersionCode + +```java +/** + * Samples for EdgeActionVersions GetVersionCode. + */ +public final class EdgeActionVersionsGetVersionCodeSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_GetVersionCode.json + */ + /** + * Sample code: GetVersionCode. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getVersionCode(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .getVersionCode("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_ListByEdgeAction + +```java +/** + * Samples for EdgeActionVersions ListByEdgeAction. + */ +public final class EdgeActionVersionsListByEdgeActionSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_ListByEdgeAction.json + */ + /** + * Sample code: GetEdgeActionVersionsByEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + getEdgeActionVersionsByEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().listByEdgeAction("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_SwapDefault + +```java +/** + * Samples for EdgeActionVersions SwapDefault. + */ +public final class EdgeActionVersionsSwapDefaultSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_SwapDefault.json + */ + /** + * Sample code: Swap Default Version. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void swapDefaultVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().swapDefault("testrg", "edgeAction1", "1.0", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActionVersions_Update + +```java +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; + +/** + * Samples for EdgeActionVersions Update. + */ +public final class EdgeActionVersionsUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Update.json + */ + /** + * Sample code: UpdateEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void updateEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeActionVersion resource = manager.edgeActionVersions() + .getWithResponse("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.OTHERS)) + .apply(); + } +} +``` + +### EdgeActions_AddAttachment + +```java +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; + +/** + * Samples for EdgeActions AddAttachment. + */ +public final class EdgeActionsAddAttachmentSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_AddAttachment.json + */ + /** + * Sample code: AddAttachment. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void addAttachment(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .addAttachment("testrg", "edgeAction1", new EdgeActionAttachment().withAttachedResourceId( + "/subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_Create + +```java +import com.azure.resourcemanager.edgeactions.models.SkuType; + +/** + * Samples for EdgeActions Create. + */ +public final class EdgeActionsCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Create.json + */ + /** + * Sample code: CreateEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void createEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .define("edgeAction1") + .withRegion("global") + .withExistingResourceGroup("testrg") + .withSku(new SkuType().withName("Standard").withTier("Standard")) + .create(); + } +} +``` + +### EdgeActions_Delete + +```java +/** + * Samples for EdgeActions Delete. + */ +public final class EdgeActionsDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Delete.json + */ + /** + * Sample code: DeleteEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().delete("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_DeleteAttachment + +```java +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; + +/** + * Samples for EdgeActions DeleteAttachment. + */ +public final class EdgeActionsDeleteAttachmentSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_DeleteAttachment.json + */ + /** + * Sample code: DeleteAttachment. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteAttachment(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .deleteAttachment("testrg", "edgeAction1", new EdgeActionAttachment().withAttachedResourceId( + "/subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1"), + com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_GetByResourceGroup + +```java +/** + * Samples for EdgeActions GetByResourceGroup. + */ +public final class EdgeActionsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Get.json + */ + /** + * Sample code: GetEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().getByResourceGroupWithResponse("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_List + +```java +/** + * Samples for EdgeActions List. + */ +public final class EdgeActionsListSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_ListBySubscription.json + */ + /** + * Sample code: ListEdgeActions_bySubscription. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void listEdgeActionsBySubscription(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().list(com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_ListByResourceGroup + +```java +/** + * Samples for EdgeActions ListByResourceGroup. + */ +public final class EdgeActionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_ListByResourceGroup.json + */ + /** + * Sample code: ListEdgeActions_byResourceGroup. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + listEdgeActionsByResourceGroup(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} +``` + +### EdgeActions_Update + +```java +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import com.azure.resourcemanager.edgeactions.models.SkuType; + +/** + * Samples for EdgeActions Update. + */ +public final class EdgeActionsUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Update.json + */ + /** + * Sample code: UpdateEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void updateEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeAction resource = manager.edgeActions() + .getByResourceGroupWithResponse("testrg", "edgeAction1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new SkuType().withName("Standard").withTier("Standard")).apply(); + } +} +``` + diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml b/sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml new file mode 100644 index 000000000000..67f09f625cd9 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-edgeactions + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for EdgeActions Management + This package contains Microsoft Azure SDK for EdgeActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package api-version 2025-09-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.57.0 + + + com.azure + azure-core-management + 1.19.2 + + + com.azure + azure-core-test + 1.27.0-beta.13 + test + + + com.azure + azure-identity + 1.18.1 + test + + + diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/EdgeActionsManager.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/EdgeActionsManager.java new file mode 100644 index 000000000000..36ac184c84a6 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/EdgeActionsManager.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionsManagementClient; +import com.azure.resourcemanager.edgeactions.implementation.EdgeActionExecutionFiltersImpl; +import com.azure.resourcemanager.edgeactions.implementation.EdgeActionVersionsImpl; +import com.azure.resourcemanager.edgeactions.implementation.EdgeActionsImpl; +import com.azure.resourcemanager.edgeactions.implementation.EdgeActionsManagementClientBuilder; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilters; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersions; +import com.azure.resourcemanager.edgeactions.models.EdgeActions; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to EdgeActionsManager. + */ +public final class EdgeActionsManager { + private EdgeActions edgeActions; + + private EdgeActionVersions edgeActionVersions; + + private EdgeActionExecutionFilters edgeActionExecutionFilters; + + private final EdgeActionsManagementClient clientObject; + + private EdgeActionsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new EdgeActionsManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of EdgeActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EdgeActions service API instance. + */ + public static EdgeActionsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of EdgeActions service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the EdgeActions service API instance. + */ + public static EdgeActionsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new EdgeActionsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create EdgeActionsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new EdgeActionsManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-edgeactions.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of EdgeActions service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the EdgeActions service API instance. + */ + public EdgeActionsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.edgeactions") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new EdgeActionsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of EdgeActions. It manages EdgeAction. + * + * @return Resource collection API of EdgeActions. + */ + public EdgeActions edgeActions() { + if (this.edgeActions == null) { + this.edgeActions = new EdgeActionsImpl(clientObject.getEdgeActions(), this); + } + return edgeActions; + } + + /** + * Gets the resource collection API of EdgeActionVersions. It manages EdgeActionVersion. + * + * @return Resource collection API of EdgeActionVersions. + */ + public EdgeActionVersions edgeActionVersions() { + if (this.edgeActionVersions == null) { + this.edgeActionVersions = new EdgeActionVersionsImpl(clientObject.getEdgeActionVersions(), this); + } + return edgeActionVersions; + } + + /** + * Gets the resource collection API of EdgeActionExecutionFilters. It manages EdgeActionExecutionFilter. + * + * @return Resource collection API of EdgeActionExecutionFilters. + */ + public EdgeActionExecutionFilters edgeActionExecutionFilters() { + if (this.edgeActionExecutionFilters == null) { + this.edgeActionExecutionFilters + = new EdgeActionExecutionFiltersImpl(clientObject.getEdgeActionExecutionFilters(), this); + } + return edgeActionExecutionFilters; + } + + /** + * Gets wrapped service client EdgeActionsManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client EdgeActionsManagementClient. + */ + public EdgeActionsManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionExecutionFiltersClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionExecutionFiltersClient.java new file mode 100644 index 000000000000..3865e9006b52 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionExecutionFiltersClient.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionExecutionFiltersClient. + */ +public interface EdgeActionExecutionFiltersClient { + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, Context context); + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionExecutionFilterInner get(String resourceGroupName, String edgeActionName, String executionFilter); + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionExecutionFilterInner> beginCreate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource); + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionExecutionFilterInner> beginCreate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource, Context context); + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionExecutionFilterInner create(String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource); + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionExecutionFilterInner create(String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource, Context context); + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionExecutionFilterInner> beginUpdate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties); + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionExecutionFilterInner> beginUpdate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties, Context context); + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionExecutionFilterInner update(String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties); + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionExecutionFilterInner update(String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties, Context context); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName, + String executionFilter); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName, + String executionFilter, Context context); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName, String executionFilter); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName, String executionFilter, Context context); + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName); + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java new file mode 100644 index 000000000000..9741462aab98 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionVersionsClient. + */ +public interface EdgeActionVersionsClient { + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String edgeActionName, String version, + Context context); + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionInner get(String resourceGroupName, String edgeActionName, String version); + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionInner> beginCreate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner resource); + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionInner> beginCreate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner resource, Context context); + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionInner create(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource); + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionInner create(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource, Context context); + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionInner> beginUpdate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner properties); + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionInner> beginUpdate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner properties, Context context); + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionInner update(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties); + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionInner update(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties, Context context); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName, String version); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName, String version, + Context context); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName, String version); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName, String version, Context context); + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName); + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionPropertiesInner> + beginDeployVersionCode(String resourceGroupName, String edgeActionName, String version, VersionCodeInner body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionVersionPropertiesInner> beginDeployVersionCode( + String resourceGroupName, String edgeActionName, String version, VersionCodeInner body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, String edgeActionName, String version, + VersionCodeInner body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, String edgeActionName, String version, + VersionCodeInner body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, VersionCodeInner> beginGetVersionCode(String resourceGroupName, + String edgeActionName, String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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, VersionCodeInner> beginGetVersionCode(String resourceGroupName, + String edgeActionName, String version, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VersionCodeInner getVersionCode(String resourceGroupName, String edgeActionName, String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VersionCodeInner getVersionCode(String resourceGroupName, String edgeActionName, String version, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginSwapDefault(String resourceGroupName, String edgeActionName, + String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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> beginSwapDefault(String resourceGroupName, String edgeActionName, String version, + Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapDefault(String resourceGroupName, String edgeActionName, String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 swapDefault(String resourceGroupName, String edgeActionName, String version, Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsClient.java new file mode 100644 index 000000000000..f638bf4192fb --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsClient.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionsClient. + */ +public interface EdgeActionsClient { + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String edgeActionName, + Context context); + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionInner getByResourceGroup(String resourceGroupName, String edgeActionName); + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionInner> beginCreate(String resourceGroupName, + String edgeActionName, EdgeActionInner resource); + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionInner> beginCreate(String resourceGroupName, + String edgeActionName, EdgeActionInner resource, Context context); + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionInner create(String resourceGroupName, String edgeActionName, EdgeActionInner resource); + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource 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 concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionInner create(String resourceGroupName, String edgeActionName, EdgeActionInner resource, Context context); + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionInner> beginUpdate(String resourceGroupName, + String edgeActionName, EdgeActionInner properties); + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionInner> beginUpdate(String resourceGroupName, + String edgeActionName, EdgeActionInner properties, Context context); + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionInner update(String resourceGroupName, String edgeActionName, EdgeActionInner properties); + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionInner update(String resourceGroupName, String edgeActionName, EdgeActionInner properties, + Context context); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 edgeActionName, Context context); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 edgeActionName, Context context); + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List EdgeAction resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List EdgeAction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionAttachmentResponseInner> + beginAddAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EdgeActionAttachmentResponseInner> + beginAddAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionAttachmentResponseInner addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EdgeActionAttachmentResponseInner addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsManagementClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsManagementClient.java new file mode 100644 index 000000000000..bfc8afebdbdb --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsManagementClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for EdgeActionsManagementClient class. + */ +public interface EdgeActionsManagementClient { + /** + * 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 EdgeActionsClient object to access its operations. + * + * @return the EdgeActionsClient object. + */ + EdgeActionsClient getEdgeActions(); + + /** + * Gets the EdgeActionVersionsClient object to access its operations. + * + * @return the EdgeActionVersionsClient object. + */ + EdgeActionVersionsClient getEdgeActionVersions(); + + /** + * Gets the EdgeActionExecutionFiltersClient object to access its operations. + * + * @return the EdgeActionExecutionFiltersClient object. + */ + EdgeActionExecutionFiltersClient getEdgeActionExecutionFilters(); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionAttachmentResponseInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionAttachmentResponseInner.java new file mode 100644 index 000000000000..8737fb59740e --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionAttachmentResponseInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Edge action attachment response. + */ +@Immutable +public final class EdgeActionAttachmentResponseInner implements JsonSerializable { + /* + * Non changing guid to identity edge action + */ + private String edgeActionId; + + /** + * Creates an instance of EdgeActionAttachmentResponseInner class. + */ + private EdgeActionAttachmentResponseInner() { + } + + /** + * Get the edgeActionId property: Non changing guid to identity edge action. + * + * @return the edgeActionId value. + */ + public String edgeActionId() { + return this.edgeActionId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("edgeActionId", this.edgeActionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionAttachmentResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionAttachmentResponseInner 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 EdgeActionAttachmentResponseInner. + */ + public static EdgeActionAttachmentResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionAttachmentResponseInner deserializedEdgeActionAttachmentResponseInner + = new EdgeActionAttachmentResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("edgeActionId".equals(fieldName)) { + deserializedEdgeActionAttachmentResponseInner.edgeActionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionAttachmentResponseInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionExecutionFilterInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionExecutionFilterInner.java new file mode 100644 index 000000000000..d46ec54c3a72 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionExecutionFilterInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.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; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class EdgeActionExecutionFilterInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EdgeActionExecutionFilterProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EdgeActionExecutionFilterInner class. + */ + public EdgeActionExecutionFilterInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EdgeActionExecutionFilterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EdgeActionExecutionFilterInner object itself. + */ + public EdgeActionExecutionFilterInner withProperties(EdgeActionExecutionFilterProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionExecutionFilterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionExecutionFilterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionExecutionFilterInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionExecutionFilterInner 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 EdgeActionExecutionFilterInner. + */ + public static EdgeActionExecutionFilterInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionExecutionFilterInner deserializedEdgeActionExecutionFilterInner + = new EdgeActionExecutionFilterInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEdgeActionExecutionFilterInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.properties + = EdgeActionExecutionFilterProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEdgeActionExecutionFilterInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionExecutionFilterInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionInner.java new file mode 100644 index 000000000000..6f7eec26c85c --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.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; +import com.azure.resourcemanager.edgeactions.models.EdgeActionProperties; +import com.azure.resourcemanager.edgeactions.models.SkuType; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class EdgeActionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EdgeActionProperties properties; + + /* + * The sku type of the edge action + */ + private SkuType sku; + + /* + * 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 EdgeActionInner class. + */ + public EdgeActionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EdgeActionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EdgeActionInner object itself. + */ + public EdgeActionInner withProperties(EdgeActionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: The sku type of the edge action. + * + * @return the sku value. + */ + public SkuType sku() { + return this.sku; + } + + /** + * Set the sku property: The sku type of the edge action. + * + * @param sku the sku value to set. + * @return the EdgeActionInner object itself. + */ + public EdgeActionInner withSku(SkuType sku) { + this.sku = sku; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @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("sku", this.sku); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionInner 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 EdgeActionInner. + */ + public static EdgeActionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionInner deserializedEdgeActionInner = new EdgeActionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeActionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEdgeActionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEdgeActionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEdgeActionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEdgeActionInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedEdgeActionInner.sku = SkuType.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedEdgeActionInner.properties = EdgeActionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEdgeActionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionInner.java new file mode 100644 index 000000000000..94fe825e2057 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionInner.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.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; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class EdgeActionVersionInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private EdgeActionVersionPropertiesInner properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of EdgeActionVersionInner class. + */ + public EdgeActionVersionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public EdgeActionVersionPropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the EdgeActionVersionInner object itself. + */ + public EdgeActionVersionInner withProperties(EdgeActionVersionPropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionVersionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public EdgeActionVersionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionVersionInner 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 EdgeActionVersionInner. + */ + public static EdgeActionVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionVersionInner deserializedEdgeActionVersionInner = new EdgeActionVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeActionVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEdgeActionVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEdgeActionVersionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedEdgeActionVersionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedEdgeActionVersionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedEdgeActionVersionInner.properties = EdgeActionVersionPropertiesInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedEdgeActionVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionVersionInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionPropertiesInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionPropertiesInner.java new file mode 100644 index 000000000000..f896902e51ab --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionPropertiesInner.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent.models; + +import com.azure.core.annotation.Fluent; +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.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionValidationStatus; +import com.azure.resourcemanager.edgeactions.models.ProvisioningState; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Represents an edge action version. + */ +@Fluent +public final class EdgeActionVersionPropertiesInner implements JsonSerializable { + /* + * The deployment type + */ + private EdgeActionVersionDeploymentType deploymentType; + + /* + * The validation status + */ + private EdgeActionVersionValidationStatus validationStatus; + + /* + * The provisioning state + */ + private ProvisioningState provisioningState; + + /* + * The active state + */ + private EdgeActionIsDefaultVersion isDefaultVersion; + + /* + * The last update time in UTC for package update + */ + private OffsetDateTime lastPackageUpdateTime; + + /** + * Creates an instance of EdgeActionVersionPropertiesInner class. + */ + public EdgeActionVersionPropertiesInner() { + } + + /** + * Get the deploymentType property: The deployment type. + * + * @return the deploymentType value. + */ + public EdgeActionVersionDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. + * + * @param deploymentType the deploymentType value to set. + * @return the EdgeActionVersionPropertiesInner object itself. + */ + public EdgeActionVersionPropertiesInner withDeploymentType(EdgeActionVersionDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the validationStatus property: The validation status. + * + * @return the validationStatus value. + */ + public EdgeActionVersionValidationStatus validationStatus() { + return this.validationStatus; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the isDefaultVersion property: The active state. + * + * @return the isDefaultVersion value. + */ + public EdgeActionIsDefaultVersion isDefaultVersion() { + return this.isDefaultVersion; + } + + /** + * Set the isDefaultVersion property: The active state. + * + * @param isDefaultVersion the isDefaultVersion value to set. + * @return the EdgeActionVersionPropertiesInner object itself. + */ + public EdgeActionVersionPropertiesInner withIsDefaultVersion(EdgeActionIsDefaultVersion isDefaultVersion) { + this.isDefaultVersion = isDefaultVersion; + return this; + } + + /** + * Get the lastPackageUpdateTime property: The last update time in UTC for package update. + * + * @return the lastPackageUpdateTime value. + */ + public OffsetDateTime lastPackageUpdateTime() { + return this.lastPackageUpdateTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("isDefaultVersion", + this.isDefaultVersion == null ? null : this.isDefaultVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionVersionPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionVersionPropertiesInner 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 EdgeActionVersionPropertiesInner. + */ + public static EdgeActionVersionPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionVersionPropertiesInner deserializedEdgeActionVersionPropertiesInner + = new EdgeActionVersionPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentType".equals(fieldName)) { + deserializedEdgeActionVersionPropertiesInner.deploymentType + = EdgeActionVersionDeploymentType.fromString(reader.getString()); + } else if ("validationStatus".equals(fieldName)) { + deserializedEdgeActionVersionPropertiesInner.validationStatus + = EdgeActionVersionValidationStatus.fromString(reader.getString()); + } else if ("isDefaultVersion".equals(fieldName)) { + deserializedEdgeActionVersionPropertiesInner.isDefaultVersion + = EdgeActionIsDefaultVersion.fromString(reader.getString()); + } else if ("lastPackageUpdateTime".equals(fieldName)) { + deserializedEdgeActionVersionPropertiesInner.lastPackageUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisioningState".equals(fieldName)) { + deserializedEdgeActionVersionPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionVersionPropertiesInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/VersionCodeInner.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/VersionCodeInner.java new file mode 100644 index 000000000000..a13bb0da9df2 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/VersionCodeInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Version code information for edge action. + */ +@Fluent +public final class VersionCodeInner implements JsonSerializable { + /* + * The version code deployment content + */ + private String content; + + /* + * The version code name + */ + private String name; + + /** + * Creates an instance of VersionCodeInner class. + */ + public VersionCodeInner() { + } + + /** + * Get the content property: The version code deployment content. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The version code deployment content. + * + * @param content the content value to set. + * @return the VersionCodeInner object itself. + */ + public VersionCodeInner withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the name property: The version code name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The version code name. + * + * @param name the name value to set. + * @return the VersionCodeInner object itself. + */ + public VersionCodeInner withName(String name) { + this.name = name; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersionCodeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersionCodeInner 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 VersionCodeInner. + */ + public static VersionCodeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersionCodeInner deserializedVersionCodeInner = new VersionCodeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedVersionCodeInner.content = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVersionCodeInner.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVersionCodeInner; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/package-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/package-info.java new file mode 100644 index 000000000000..f64e951de29f --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for EdgeActionsManagementClient. + */ +package com.azure.resourcemanager.edgeactions.fluent.models; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/package-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/package-info.java new file mode 100644 index 000000000000..f2b3b7cd976a --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for EdgeActionsManagementClient. + */ +package com.azure.resourcemanager.edgeactions.fluent; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionAttachmentResponseImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionAttachmentResponseImpl.java new file mode 100644 index 000000000000..84cf6f5255de --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionAttachmentResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachmentResponse; + +public final class EdgeActionAttachmentResponseImpl implements EdgeActionAttachmentResponse { + private EdgeActionAttachmentResponseInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + EdgeActionAttachmentResponseImpl(EdgeActionAttachmentResponseInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String edgeActionId() { + return this.innerModel().edgeActionId(); + } + + public EdgeActionAttachmentResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFilterImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFilterImpl.java new file mode 100644 index 000000000000..960d14d8526a --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFilterImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; +import java.util.Collections; +import java.util.Map; + +public final class EdgeActionExecutionFilterImpl + implements EdgeActionExecutionFilter, EdgeActionExecutionFilter.Definition, EdgeActionExecutionFilter.Update { + private EdgeActionExecutionFilterInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EdgeActionExecutionFilterProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EdgeActionExecutionFilterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String edgeActionName; + + private String executionFilter; + + public EdgeActionExecutionFilterImpl withExistingEdgeAction(String resourceGroupName, String edgeActionName) { + this.resourceGroupName = resourceGroupName; + this.edgeActionName = edgeActionName; + return this; + } + + public EdgeActionExecutionFilter create() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .create(resourceGroupName, edgeActionName, executionFilter, this.innerModel(), Context.NONE); + return this; + } + + public EdgeActionExecutionFilter create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .create(resourceGroupName, edgeActionName, executionFilter, this.innerModel(), context); + return this; + } + + EdgeActionExecutionFilterImpl(String name, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = new EdgeActionExecutionFilterInner(); + this.serviceManager = serviceManager; + this.executionFilter = name; + } + + public EdgeActionExecutionFilterImpl update() { + return this; + } + + public EdgeActionExecutionFilter apply() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .update(resourceGroupName, edgeActionName, executionFilter, this.innerModel(), Context.NONE); + return this; + } + + public EdgeActionExecutionFilter apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .update(resourceGroupName, edgeActionName, executionFilter, this.innerModel(), context); + return this; + } + + EdgeActionExecutionFilterImpl(EdgeActionExecutionFilterInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.edgeActionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "edgeActions"); + this.executionFilter = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "executionFilters"); + } + + public EdgeActionExecutionFilter refresh() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .getWithResponse(resourceGroupName, edgeActionName, executionFilter, Context.NONE) + .getValue(); + return this; + } + + public EdgeActionExecutionFilter refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionExecutionFilters() + .getWithResponse(resourceGroupName, edgeActionName, executionFilter, context) + .getValue(); + return this; + } + + public EdgeActionExecutionFilterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EdgeActionExecutionFilterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EdgeActionExecutionFilterImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public EdgeActionExecutionFilterImpl withProperties(EdgeActionExecutionFilterProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersClientImpl.java new file mode 100644 index 000000000000..631ad56f7a03 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersClientImpl.java @@ -0,0 +1,1004 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionExecutionFilterListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionExecutionFiltersClient. + */ +public final class EdgeActionExecutionFiltersClientImpl implements EdgeActionExecutionFiltersClient { + /** + * The proxy service used to perform REST calls. + */ + private final EdgeActionExecutionFiltersService service; + + /** + * The service client containing this operation class. + */ + private final EdgeActionsManagementClientImpl client; + + /** + * Initializes an instance of EdgeActionExecutionFiltersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeActionExecutionFiltersClientImpl(EdgeActionsManagementClientImpl client) { + this.service = RestProxy.create(EdgeActionExecutionFiltersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeActionsManagementClientEdgeActionExecutionFilters to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeActionsManagementClientEdgeActionExecutionFilters") + public interface EdgeActionExecutionFiltersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionExecutionFilterInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionExecutionFilterInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionExecutionFilterInner properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionExecutionFilterInner properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters/{executionFilter}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("executionFilter") String executionFilter, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEdgeAction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/executionFilters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByEdgeActionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEdgeActionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByEdgeActionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String edgeActionName, String executionFilter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String edgeActionName, + String executionFilter) { + return getWithResponseAsync(resourceGroupName, edgeActionName, executionFilter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, edgeActionName, executionFilter, accept, context); + } + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionExecutionFilterInner get(String resourceGroupName, String edgeActionName, String executionFilter) { + return getWithResponse(resourceGroupName, edgeActionName, executionFilter, Context.NONE).getValue(); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, accept, + resource, Context.NONE); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, accept, + resource, context); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionExecutionFilterInner> beginCreateAsync( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, edgeActionName, executionFilter, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, + this.client.getContext()); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionExecutionFilterInner> beginCreate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource) { + Response response + = createWithResponse(resourceGroupName, edgeActionName, executionFilter, resource); + return this.client.getLroResult(response, + EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, Context.NONE); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionExecutionFilterInner> beginCreate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner resource, Context context) { + Response response + = createWithResponse(resourceGroupName, edgeActionName, executionFilter, resource, context); + return this.client.getLroResult(response, + EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, context); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource) { + return beginCreateAsync(resourceGroupName, edgeActionName, executionFilter, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionExecutionFilterInner create(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource) { + return beginCreate(resourceGroupName, edgeActionName, executionFilter, resource).getFinalResult(); + } + + /** + * Create a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionExecutionFilterInner create(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner resource, Context context) { + return beginCreate(resourceGroupName, edgeActionName, executionFilter, resource, context).getFinalResult(); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, + accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, accept, + properties, Context.NONE); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, contentType, accept, + properties, context); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionExecutionFilterInner> beginUpdateAsync( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, edgeActionName, executionFilter, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, + this.client.getContext()); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionExecutionFilterInner> beginUpdate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties) { + Response response + = updateWithResponse(resourceGroupName, edgeActionName, executionFilter, properties); + return this.client.getLroResult(response, + EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, Context.NONE); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionExecutionFilterInner> beginUpdate( + String resourceGroupName, String edgeActionName, String executionFilter, + EdgeActionExecutionFilterInner properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, edgeActionName, executionFilter, properties, context); + return this.client.getLroResult(response, + EdgeActionExecutionFilterInner.class, EdgeActionExecutionFilterInner.class, context); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties) { + return beginUpdateAsync(resourceGroupName, edgeActionName, executionFilter, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionExecutionFilterInner update(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties) { + return beginUpdate(resourceGroupName, edgeActionName, executionFilter, properties).getFinalResult(); + } + + /** + * Update a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionExecutionFilterInner update(String resourceGroupName, String edgeActionName, + String executionFilter, EdgeActionExecutionFilterInner properties, Context context) { + return beginUpdate(resourceGroupName, edgeActionName, executionFilter, properties, context).getFinalResult(); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName, + String executionFilter) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, Context.NONE); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, executionFilter, context); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName, + String executionFilter) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, edgeActionName, executionFilter); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName, + String executionFilter) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName, executionFilter); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName, + String executionFilter, Context context) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName, executionFilter, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String edgeActionName, String executionFilter) { + return beginDeleteAsync(resourceGroupName, edgeActionName, executionFilter).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName, String executionFilter) { + beginDelete(resourceGroupName, edgeActionName, executionFilter).getFinalResult(); + } + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName, String executionFilter, Context context) { + beginDelete(resourceGroupName, edgeActionName, executionFilter, context).getFinalResult(); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByEdgeActionSinglePageAsync(String resourceGroupName, String edgeActionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEdgeAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEdgeActionAsync(String resourceGroupName, + String edgeActionName) { + return new PagedFlux<>(() -> listByEdgeActionSinglePageAsync(resourceGroupName, edgeActionName), + nextLink -> listByEdgeActionNextSinglePageAsync(nextLink)); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionSinglePage(String resourceGroupName, + String edgeActionName) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionSinglePage(String resourceGroupName, + String edgeActionName, Context context) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEdgeAction(String resourceGroupName, + String edgeActionName) { + return new PagedIterable<>(() -> listByEdgeActionSinglePage(resourceGroupName, edgeActionName), + nextLink -> listByEdgeActionNextSinglePage(nextLink)); + } + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEdgeAction(String resourceGroupName, + String edgeActionName, Context context) { + return new PagedIterable<>(() -> listByEdgeActionSinglePage(resourceGroupName, edgeActionName, context), + nextLink -> listByEdgeActionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEdgeActionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEdgeActionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersImpl.java new file mode 100644 index 000000000000..ecf63dc5594a --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilters; + +public final class EdgeActionExecutionFiltersImpl implements EdgeActionExecutionFilters { + private static final ClientLogger LOGGER = new ClientLogger(EdgeActionExecutionFiltersImpl.class); + + private final EdgeActionExecutionFiltersClient innerClient; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public EdgeActionExecutionFiltersImpl(EdgeActionExecutionFiltersClient innerClient, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, edgeActionName, executionFilter, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EdgeActionExecutionFilterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EdgeActionExecutionFilter get(String resourceGroupName, String edgeActionName, String executionFilter) { + EdgeActionExecutionFilterInner inner + = this.serviceClient().get(resourceGroupName, edgeActionName, executionFilter); + if (inner != null) { + return new EdgeActionExecutionFilterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String edgeActionName, String executionFilter) { + this.serviceClient().delete(resourceGroupName, edgeActionName, executionFilter); + } + + public void delete(String resourceGroupName, String edgeActionName, String executionFilter, Context context) { + this.serviceClient().delete(resourceGroupName, edgeActionName, executionFilter, context); + } + + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName) { + PagedIterable inner + = this.serviceClient().listByEdgeAction(resourceGroupName, edgeActionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionExecutionFilterImpl(inner1, this.manager())); + } + + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEdgeAction(resourceGroupName, edgeActionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionExecutionFilterImpl(inner1, this.manager())); + } + + public EdgeActionExecutionFilter getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String executionFilter = ResourceManagerUtils.getValueFromIdByName(id, "executionFilters"); + if (executionFilter == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, edgeActionName, executionFilter, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String executionFilter = ResourceManagerUtils.getValueFromIdByName(id, "executionFilters"); + if (executionFilter == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionFilters'.", id))); + } + return this.getWithResponse(resourceGroupName, edgeActionName, executionFilter, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String executionFilter = ResourceManagerUtils.getValueFromIdByName(id, "executionFilters"); + if (executionFilter == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionFilters'.", id))); + } + this.delete(resourceGroupName, edgeActionName, executionFilter, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String executionFilter = ResourceManagerUtils.getValueFromIdByName(id, "executionFilters"); + if (executionFilter == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionFilters'.", id))); + } + this.delete(resourceGroupName, edgeActionName, executionFilter, context); + } + + private EdgeActionExecutionFiltersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + public EdgeActionExecutionFilterImpl define(String name) { + return new EdgeActionExecutionFilterImpl(name, this.manager()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionImpl.java new file mode 100644 index 000000000000..2aaa3fd3e325 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachmentResponse; +import com.azure.resourcemanager.edgeactions.models.EdgeActionProperties; +import com.azure.resourcemanager.edgeactions.models.SkuType; +import java.util.Collections; +import java.util.Map; + +public final class EdgeActionImpl implements EdgeAction, EdgeAction.Definition, EdgeAction.Update { + private EdgeActionInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EdgeActionProperties properties() { + return this.innerModel().properties(); + } + + public SkuType sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EdgeActionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String edgeActionName; + + public EdgeActionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public EdgeAction create() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .create(resourceGroupName, edgeActionName, this.innerModel(), Context.NONE); + return this; + } + + public EdgeAction create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .create(resourceGroupName, edgeActionName, this.innerModel(), context); + return this; + } + + EdgeActionImpl(String name, com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = new EdgeActionInner(); + this.serviceManager = serviceManager; + this.edgeActionName = name; + } + + public EdgeActionImpl update() { + return this; + } + + public EdgeAction apply() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .update(resourceGroupName, edgeActionName, this.innerModel(), Context.NONE); + return this; + } + + public EdgeAction apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .update(resourceGroupName, edgeActionName, this.innerModel(), context); + return this; + } + + EdgeActionImpl(EdgeActionInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.edgeActionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "edgeActions"); + } + + public EdgeAction refresh() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .getByResourceGroupWithResponse(resourceGroupName, edgeActionName, Context.NONE) + .getValue(); + return this; + } + + public EdgeAction refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActions() + .getByResourceGroupWithResponse(resourceGroupName, edgeActionName, context) + .getValue(); + return this; + } + + public EdgeActionAttachmentResponse addAttachment(EdgeActionAttachment body) { + return serviceManager.edgeActions().addAttachment(resourceGroupName, edgeActionName, body); + } + + public EdgeActionAttachmentResponse addAttachment(EdgeActionAttachment body, Context context) { + return serviceManager.edgeActions().addAttachment(resourceGroupName, edgeActionName, body, context); + } + + public void deleteAttachment(EdgeActionAttachment body) { + serviceManager.edgeActions().deleteAttachment(resourceGroupName, edgeActionName, body); + } + + public void deleteAttachment(EdgeActionAttachment body, Context context) { + serviceManager.edgeActions().deleteAttachment(resourceGroupName, edgeActionName, body, context); + } + + public EdgeActionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EdgeActionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EdgeActionImpl withSku(SkuType sku) { + this.innerModel().withSku(sku); + return this; + } + + public EdgeActionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public EdgeActionImpl withProperties(EdgeActionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionImpl.java new file mode 100644 index 000000000000..234ec88afd79 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionProperties; +import com.azure.resourcemanager.edgeactions.models.VersionCode; +import java.util.Collections; +import java.util.Map; + +public final class EdgeActionVersionImpl + implements EdgeActionVersion, EdgeActionVersion.Definition, EdgeActionVersion.Update { + private EdgeActionVersionInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EdgeActionVersionProperties properties() { + EdgeActionVersionPropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new EdgeActionVersionPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public EdgeActionVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String edgeActionName; + + private String version; + + public EdgeActionVersionImpl withExistingEdgeAction(String resourceGroupName, String edgeActionName) { + this.resourceGroupName = resourceGroupName; + this.edgeActionName = edgeActionName; + return this; + } + + public EdgeActionVersion create() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .create(resourceGroupName, edgeActionName, version, this.innerModel(), Context.NONE); + return this; + } + + public EdgeActionVersion create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .create(resourceGroupName, edgeActionName, version, this.innerModel(), context); + return this; + } + + EdgeActionVersionImpl(String name, com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = new EdgeActionVersionInner(); + this.serviceManager = serviceManager; + this.version = name; + } + + public EdgeActionVersionImpl update() { + return this; + } + + public EdgeActionVersion apply() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .update(resourceGroupName, edgeActionName, version, this.innerModel(), Context.NONE); + return this; + } + + public EdgeActionVersion apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .update(resourceGroupName, edgeActionName, version, this.innerModel(), context); + return this; + } + + EdgeActionVersionImpl(EdgeActionVersionInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.edgeActionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "edgeActions"); + this.version = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "versions"); + } + + public EdgeActionVersion refresh() { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .getWithResponse(resourceGroupName, edgeActionName, version, Context.NONE) + .getValue(); + return this; + } + + public EdgeActionVersion refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getEdgeActionVersions() + .getWithResponse(resourceGroupName, edgeActionName, version, context) + .getValue(); + return this; + } + + public EdgeActionVersionProperties deployVersionCode(VersionCodeInner body) { + return serviceManager.edgeActionVersions().deployVersionCode(resourceGroupName, edgeActionName, version, body); + } + + public EdgeActionVersionProperties deployVersionCode(VersionCodeInner body, Context context) { + return serviceManager.edgeActionVersions() + .deployVersionCode(resourceGroupName, edgeActionName, version, body, context); + } + + public VersionCode getVersionCode() { + return serviceManager.edgeActionVersions().getVersionCode(resourceGroupName, edgeActionName, version); + } + + public VersionCode getVersionCode(Context context) { + return serviceManager.edgeActionVersions().getVersionCode(resourceGroupName, edgeActionName, version, context); + } + + public void swapDefault() { + serviceManager.edgeActionVersions().swapDefault(resourceGroupName, edgeActionName, version); + } + + public void swapDefault(Context context) { + serviceManager.edgeActionVersions().swapDefault(resourceGroupName, edgeActionName, version, context); + } + + public EdgeActionVersionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public EdgeActionVersionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public EdgeActionVersionImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public EdgeActionVersionImpl withProperties(EdgeActionVersionPropertiesInner properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionPropertiesImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionPropertiesImpl.java new file mode 100644 index 000000000000..150eda2cd70c --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionPropertiesImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionProperties; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionValidationStatus; +import com.azure.resourcemanager.edgeactions.models.ProvisioningState; +import java.time.OffsetDateTime; + +public final class EdgeActionVersionPropertiesImpl implements EdgeActionVersionProperties { + private EdgeActionVersionPropertiesInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + EdgeActionVersionPropertiesImpl(EdgeActionVersionPropertiesInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public EdgeActionVersionDeploymentType deploymentType() { + return this.innerModel().deploymentType(); + } + + public EdgeActionVersionValidationStatus validationStatus() { + return this.innerModel().validationStatus(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public EdgeActionIsDefaultVersion isDefaultVersion() { + return this.innerModel().isDefaultVersion(); + } + + public OffsetDateTime lastPackageUpdateTime() { + return this.innerModel().lastPackageUpdateTime(); + } + + public EdgeActionVersionPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java new file mode 100644 index 000000000000..aec86c98e652 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java @@ -0,0 +1,1571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionVersionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionVersionsClient. + */ +public final class EdgeActionVersionsClientImpl implements EdgeActionVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EdgeActionVersionsService service; + + /** + * The service client containing this operation class. + */ + private final EdgeActionsManagementClientImpl client; + + /** + * Initializes an instance of EdgeActionVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeActionVersionsClientImpl(EdgeActionsManagementClientImpl client) { + this.service = RestProxy.create(EdgeActionVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeActionsManagementClientEdgeActionVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeActionsManagementClientEdgeActionVersions") + public interface EdgeActionVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionVersionInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionVersionInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionVersionInner properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EdgeActionVersionInner properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEdgeAction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByEdgeActionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/deployVersionCode") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deployVersionCode(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") VersionCodeInner body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/deployVersionCode") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deployVersionCodeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") VersionCodeInner body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/getVersionCode") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> getVersionCode(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/getVersionCode") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getVersionCodeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/swapDefault") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> swapDefault(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/versions/{version}/swapDefault") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response swapDefaultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @PathParam("version") String version, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEdgeActionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByEdgeActionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String edgeActionName, + String version) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String edgeActionName, String version) { + return getWithResponseAsync(resourceGroupName, edgeActionName, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String edgeActionName, + String version, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, edgeActionName, version, accept, context); + } + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionInner get(String resourceGroupName, String edgeActionName, String version) { + return getWithResponse(resourceGroupName, edgeActionName, version, Context.NONE).getValue(); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String edgeActionName, + String version, EdgeActionVersionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, + resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, resource, + Context.NONE); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, resource, + context); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionVersionInner> beginCreateAsync( + String resourceGroupName, String edgeActionName, String version, EdgeActionVersionInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, edgeActionName, version, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionVersionInner.class, EdgeActionVersionInner.class, + this.client.getContext()); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionInner> beginCreate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner resource) { + Response response = createWithResponse(resourceGroupName, edgeActionName, version, resource); + return this.client.getLroResult(response, + EdgeActionVersionInner.class, EdgeActionVersionInner.class, Context.NONE); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionInner> beginCreate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner resource, Context context) { + Response response + = createWithResponse(resourceGroupName, edgeActionName, version, resource, context); + return this.client.getLroResult(response, + EdgeActionVersionInner.class, EdgeActionVersionInner.class, context); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource) { + return beginCreateAsync(resourceGroupName, edgeActionName, version, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionInner create(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource) { + return beginCreate(resourceGroupName, edgeActionName, version, resource).getFinalResult(); + } + + /** + * Create a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionInner create(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner resource, Context context) { + return beginCreate(resourceGroupName, edgeActionName, version, resource, context).getFinalResult(); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String edgeActionName, + String version, EdgeActionVersionInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, + properties, Context.NONE); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, + properties, context); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionVersionInner> beginUpdateAsync( + String resourceGroupName, String edgeActionName, String version, EdgeActionVersionInner properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, edgeActionName, version, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionVersionInner.class, EdgeActionVersionInner.class, + this.client.getContext()); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionInner> beginUpdate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner properties) { + Response response = updateWithResponse(resourceGroupName, edgeActionName, version, properties); + return this.client.getLroResult(response, + EdgeActionVersionInner.class, EdgeActionVersionInner.class, Context.NONE); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionInner> beginUpdate(String resourceGroupName, + String edgeActionName, String version, EdgeActionVersionInner properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, edgeActionName, version, properties, context); + return this.client.getLroResult(response, + EdgeActionVersionInner.class, EdgeActionVersionInner.class, context); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties) { + return beginUpdateAsync(resourceGroupName, edgeActionName, version, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionInner update(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties) { + return beginUpdate(resourceGroupName, edgeActionName, version, properties).getFinalResult(); + } + + /** + * Update a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionInner update(String resourceGroupName, String edgeActionName, String version, + EdgeActionVersionInner properties, Context context) { + return beginUpdate(resourceGroupName, edgeActionName, version, properties, context).getFinalResult(); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName, + String version) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName, String version) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, Context.NONE); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName, String version, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, context); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName, + String version) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName, + String version) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName, + String version, Context context) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName, version, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String edgeActionName, String version) { + return beginDeleteAsync(resourceGroupName, edgeActionName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName, String version) { + beginDelete(resourceGroupName, edgeActionName, version).getFinalResult(); + } + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName, String version, Context context) { + beginDelete(resourceGroupName, edgeActionName, version, context).getFinalResult(); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEdgeActionSinglePageAsync(String resourceGroupName, + String edgeActionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEdgeAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEdgeActionAsync(String resourceGroupName, String edgeActionName) { + return new PagedFlux<>(() -> listByEdgeActionSinglePageAsync(resourceGroupName, edgeActionName), + nextLink -> listByEdgeActionNextSinglePageAsync(nextLink)); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionSinglePage(String resourceGroupName, + String edgeActionName) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionSinglePage(String resourceGroupName, + String edgeActionName, Context context) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName) { + return new PagedIterable<>(() -> listByEdgeActionSinglePage(resourceGroupName, edgeActionName), + nextLink -> listByEdgeActionNextSinglePage(nextLink)); + } + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context) { + return new PagedIterable<>(() -> listByEdgeActionSinglePage(resourceGroupName, edgeActionName, context), + nextLink -> listByEdgeActionNextSinglePage(nextLink, context)); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deployVersionCodeWithResponseAsync(String resourceGroupName, + String edgeActionName, String version, VersionCodeInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deployVersionCode(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, body, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deployVersionCodeWithResponse(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.deployVersionCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, body, + Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deployVersionCodeWithResponse(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.deployVersionCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, contentType, accept, body, + context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionVersionPropertiesInner> + beginDeployVersionCodeAsync(String resourceGroupName, String edgeActionName, String version, + VersionCodeInner body) { + Mono>> mono + = deployVersionCodeWithResponseAsync(resourceGroupName, edgeActionName, version, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionVersionPropertiesInner.class, + EdgeActionVersionPropertiesInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionPropertiesInner> + beginDeployVersionCode(String resourceGroupName, String edgeActionName, String version, VersionCodeInner body) { + Response response = deployVersionCodeWithResponse(resourceGroupName, edgeActionName, version, body); + return this.client.getLroResult(response, + EdgeActionVersionPropertiesInner.class, EdgeActionVersionPropertiesInner.class, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionVersionPropertiesInner> + beginDeployVersionCode(String resourceGroupName, String edgeActionName, String version, VersionCodeInner body, + Context context) { + Response response + = deployVersionCodeWithResponse(resourceGroupName, edgeActionName, version, body, context); + return this.client.getLroResult(response, + EdgeActionVersionPropertiesInner.class, EdgeActionVersionPropertiesInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deployVersionCodeAsync(String resourceGroupName, + String edgeActionName, String version, VersionCodeInner body) { + return beginDeployVersionCodeAsync(resourceGroupName, edgeActionName, version, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body) { + return beginDeployVersionCode(resourceGroupName, edgeActionName, version, body).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body, Context context) { + return beginDeployVersionCode(resourceGroupName, edgeActionName, version, body, context).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getVersionCodeWithResponseAsync(String resourceGroupName, + String edgeActionName, String version) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getVersionCode(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getVersionCodeWithResponse(String resourceGroupName, String edgeActionName, + String version) { + final String accept = "application/json"; + return service.getVersionCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, accept, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getVersionCodeWithResponse(String resourceGroupName, String edgeActionName, + String version, Context context) { + final String accept = "application/json"; + return service.getVersionCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, accept, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, VersionCodeInner> + beginGetVersionCodeAsync(String resourceGroupName, String edgeActionName, String version) { + Mono>> mono + = getVersionCodeWithResponseAsync(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + VersionCodeInner.class, VersionCodeInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, VersionCodeInner> beginGetVersionCode(String resourceGroupName, + String edgeActionName, String version) { + Response response = getVersionCodeWithResponse(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(response, VersionCodeInner.class, + VersionCodeInner.class, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, VersionCodeInner> beginGetVersionCode(String resourceGroupName, + String edgeActionName, String version, Context context) { + Response response = getVersionCodeWithResponse(resourceGroupName, edgeActionName, version, context); + return this.client.getLroResult(response, VersionCodeInner.class, + VersionCodeInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getVersionCodeAsync(String resourceGroupName, String edgeActionName, + String version) { + return beginGetVersionCodeAsync(resourceGroupName, edgeActionName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VersionCodeInner getVersionCode(String resourceGroupName, String edgeActionName, String version) { + return beginGetVersionCode(resourceGroupName, edgeActionName, version).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VersionCodeInner getVersionCode(String resourceGroupName, String edgeActionName, String version, + Context context) { + return beginGetVersionCode(resourceGroupName, edgeActionName, version, context).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> swapDefaultWithResponseAsync(String resourceGroupName, + String edgeActionName, String version) { + return FluxUtil + .withContext(context -> service.swapDefault(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response swapDefaultWithResponse(String resourceGroupName, String edgeActionName, + String version) { + return service.swapDefaultSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response swapDefaultWithResponse(String resourceGroupName, String edgeActionName, + String version, Context context) { + return service.swapDefaultSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, version, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginSwapDefaultAsync(String resourceGroupName, String edgeActionName, + String version) { + Mono>> mono + = swapDefaultWithResponseAsync(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginSwapDefault(String resourceGroupName, String edgeActionName, + String version) { + Response response = swapDefaultWithResponse(resourceGroupName, edgeActionName, version); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginSwapDefault(String resourceGroupName, String edgeActionName, + String version, Context context) { + Response response = swapDefaultWithResponse(resourceGroupName, edgeActionName, version, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 swapDefaultAsync(String resourceGroupName, String edgeActionName, String version) { + return beginSwapDefaultAsync(resourceGroupName, edgeActionName, version).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 swapDefault(String resourceGroupName, String edgeActionName, String version) { + beginSwapDefault(resourceGroupName, edgeActionName, version).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 swapDefault(String resourceGroupName, String edgeActionName, String version, Context context) { + beginSwapDefault(resourceGroupName, edgeActionName, version, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByEdgeActionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEdgeActionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByEdgeActionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByEdgeActionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsImpl.java new file mode 100644 index 000000000000..3dea0d52137f --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionProperties; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersions; +import com.azure.resourcemanager.edgeactions.models.VersionCode; + +public final class EdgeActionVersionsImpl implements EdgeActionVersions { + private static final ClientLogger LOGGER = new ClientLogger(EdgeActionVersionsImpl.class); + + private final EdgeActionVersionsClient innerClient; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public EdgeActionVersionsImpl(EdgeActionVersionsClient innerClient, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String edgeActionName, String version, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, edgeActionName, version, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EdgeActionVersionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EdgeActionVersion get(String resourceGroupName, String edgeActionName, String version) { + EdgeActionVersionInner inner = this.serviceClient().get(resourceGroupName, edgeActionName, version); + if (inner != null) { + return new EdgeActionVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String edgeActionName, String version) { + this.serviceClient().delete(resourceGroupName, edgeActionName, version); + } + + public void delete(String resourceGroupName, String edgeActionName, String version, Context context) { + this.serviceClient().delete(resourceGroupName, edgeActionName, version, context); + } + + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName) { + PagedIterable inner + = this.serviceClient().listByEdgeAction(resourceGroupName, edgeActionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEdgeAction(resourceGroupName, edgeActionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionVersionImpl(inner1, this.manager())); + } + + public EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body) { + EdgeActionVersionPropertiesInner inner + = this.serviceClient().deployVersionCode(resourceGroupName, edgeActionName, version, body); + if (inner != null) { + return new EdgeActionVersionPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String edgeActionName, + String version, VersionCodeInner body, Context context) { + EdgeActionVersionPropertiesInner inner + = this.serviceClient().deployVersionCode(resourceGroupName, edgeActionName, version, body, context); + if (inner != null) { + return new EdgeActionVersionPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public VersionCode getVersionCode(String resourceGroupName, String edgeActionName, String version) { + VersionCodeInner inner = this.serviceClient().getVersionCode(resourceGroupName, edgeActionName, version); + if (inner != null) { + return new VersionCodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public VersionCode getVersionCode(String resourceGroupName, String edgeActionName, String version, + Context context) { + VersionCodeInner inner + = this.serviceClient().getVersionCode(resourceGroupName, edgeActionName, version, context); + if (inner != null) { + return new VersionCodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public void swapDefault(String resourceGroupName, String edgeActionName, String version) { + this.serviceClient().swapDefault(resourceGroupName, edgeActionName, version); + } + + public void swapDefault(String resourceGroupName, String edgeActionName, String version, Context context) { + this.serviceClient().swapDefault(resourceGroupName, edgeActionName, version, context); + } + + public EdgeActionVersion getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, edgeActionName, version, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + return this.getWithResponse(resourceGroupName, edgeActionName, version, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, edgeActionName, version, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + String version = ResourceManagerUtils.getValueFromIdByName(id, "versions"); + if (version == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); + } + this.delete(resourceGroupName, edgeActionName, version, context); + } + + private EdgeActionVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + public EdgeActionVersionImpl define(String name) { + return new EdgeActionVersionImpl(name, this.manager()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsClientImpl.java new file mode 100644 index 000000000000..bbb0bf216a80 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsClientImpl.java @@ -0,0 +1,1497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionListResult; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in EdgeActionsClient. + */ +public final class EdgeActionsClientImpl implements EdgeActionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final EdgeActionsService service; + + /** + * The service client containing this operation class. + */ + private final EdgeActionsManagementClientImpl client; + + /** + * Initializes an instance of EdgeActionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EdgeActionsClientImpl(EdgeActionsManagementClientImpl client) { + this.service + = RestProxy.create(EdgeActionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EdgeActionsManagementClientEdgeActions to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "EdgeActionsManagementClientEdgeActions") + public interface EdgeActionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionInner resource, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionInner properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionInner properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/edgeActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/edgeActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/addAttachment") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> addAttachment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionAttachment body, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/addAttachment") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response addAttachmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") EdgeActionAttachment body, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/deleteAttachment") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAttachment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") EdgeActionAttachment body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/edgeActions/{edgeActionName}/deleteAttachment") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteAttachmentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("edgeActionName") String edgeActionName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") EdgeActionAttachment body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String edgeActionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String edgeActionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, edgeActionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String edgeActionName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, accept, context); + } + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionInner getByResourceGroup(String resourceGroupName, String edgeActionName) { + return getByResourceGroupWithResponse(resourceGroupName, edgeActionName, Context.NONE).getValue(); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String edgeActionName, + EdgeActionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, resource, context); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionInner> beginCreateAsync(String resourceGroupName, + String edgeActionName, EdgeActionInner resource) { + Mono>> mono = createWithResponseAsync(resourceGroupName, edgeActionName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EdgeActionInner.class, EdgeActionInner.class, this.client.getContext()); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionInner> beginCreate(String resourceGroupName, + String edgeActionName, EdgeActionInner resource) { + Response response = createWithResponse(resourceGroupName, edgeActionName, resource); + return this.client.getLroResult(response, EdgeActionInner.class, + EdgeActionInner.class, Context.NONE); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionInner> beginCreate(String resourceGroupName, + String edgeActionName, EdgeActionInner resource, Context context) { + Response response = createWithResponse(resourceGroupName, edgeActionName, resource, context); + return this.client.getLroResult(response, EdgeActionInner.class, + EdgeActionInner.class, context); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String edgeActionName, + EdgeActionInner resource) { + return beginCreateAsync(resourceGroupName, edgeActionName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionInner create(String resourceGroupName, String edgeActionName, EdgeActionInner resource) { + return beginCreate(resourceGroupName, edgeActionName, resource).getFinalResult(); + } + + /** + * Create a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionInner create(String resourceGroupName, String edgeActionName, EdgeActionInner resource, + Context context) { + return beginCreate(resourceGroupName, edgeActionName, resource, context).getFinalResult(); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String edgeActionName, + EdgeActionInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, properties, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionInner properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionInner properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, properties, + context); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionInner> beginUpdateAsync(String resourceGroupName, + String edgeActionName, EdgeActionInner properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, edgeActionName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + EdgeActionInner.class, EdgeActionInner.class, this.client.getContext()); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionInner> beginUpdate(String resourceGroupName, + String edgeActionName, EdgeActionInner properties) { + Response response = updateWithResponse(resourceGroupName, edgeActionName, properties); + return this.client.getLroResult(response, EdgeActionInner.class, + EdgeActionInner.class, Context.NONE); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionInner> beginUpdate(String resourceGroupName, + String edgeActionName, EdgeActionInner properties, Context context) { + Response response = updateWithResponse(resourceGroupName, edgeActionName, properties, context); + return this.client.getLroResult(response, EdgeActionInner.class, + EdgeActionInner.class, context); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String edgeActionName, + EdgeActionInner properties) { + return beginUpdateAsync(resourceGroupName, edgeActionName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionInner update(String resourceGroupName, String edgeActionName, EdgeActionInner properties) { + return beginUpdate(resourceGroupName, edgeActionName, properties).getFinalResult(); + } + + /** + * Update a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionInner update(String resourceGroupName, String edgeActionName, EdgeActionInner properties, + Context context) { + return beginUpdate(resourceGroupName, edgeActionName, properties, context).getFinalResult(); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, Context.NONE); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String edgeActionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, context); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 edgeActionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, edgeActionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String edgeActionName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, edgeActionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String edgeActionName) { + return beginDeleteAsync(resourceGroupName, edgeActionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName) { + beginDelete(resourceGroupName, edgeActionName).getFinalResult(); + } + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String edgeActionName, Context context) { + beginDelete(resourceGroupName, edgeActionName, context).getFinalResult(); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List EdgeAction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> addAttachmentWithResponseAsync(String resourceGroupName, + String edgeActionName, EdgeActionAttachment body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addAttachment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addAttachmentWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addAttachmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, body, + Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addAttachmentWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.addAttachmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, accept, body, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EdgeActionAttachmentResponseInner> + beginAddAttachmentAsync(String resourceGroupName, String edgeActionName, EdgeActionAttachment body) { + Mono>> mono = addAttachmentWithResponseAsync(resourceGroupName, edgeActionName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), EdgeActionAttachmentResponseInner.class, + EdgeActionAttachmentResponseInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionAttachmentResponseInner> + beginAddAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body) { + Response response = addAttachmentWithResponse(resourceGroupName, edgeActionName, body); + return this.client.getLroResult(response, + EdgeActionAttachmentResponseInner.class, EdgeActionAttachmentResponseInner.class, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EdgeActionAttachmentResponseInner> + beginAddAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, + Context context) { + Response response = addAttachmentWithResponse(resourceGroupName, edgeActionName, body, context); + return this.client.getLroResult(response, + EdgeActionAttachmentResponseInner.class, EdgeActionAttachmentResponseInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addAttachmentAsync(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + return beginAddAttachmentAsync(resourceGroupName, edgeActionName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionAttachmentResponseInner addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + return beginAddAttachment(resourceGroupName, edgeActionName, body).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EdgeActionAttachmentResponseInner addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context) { + return beginAddAttachment(resourceGroupName, edgeActionName, body, context).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteAttachmentWithResponseAsync(String resourceGroupName, + String edgeActionName, EdgeActionAttachment body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.deleteAttachment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteAttachmentWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + final String contentType = "application/json"; + return service.deleteAttachmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, body, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteAttachmentWithResponse(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context) { + final String contentType = "application/json"; + return service.deleteAttachmentSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, edgeActionName, contentType, body, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAttachmentAsync(String resourceGroupName, + String edgeActionName, EdgeActionAttachment body) { + Mono>> mono + = deleteAttachmentWithResponseAsync(resourceGroupName, edgeActionName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + Response response = deleteAttachmentWithResponse(resourceGroupName, edgeActionName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context) { + Response response = deleteAttachmentWithResponse(resourceGroupName, edgeActionName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAttachmentAsync(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + return beginDeleteAttachmentAsync(resourceGroupName, edgeActionName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body) { + beginDeleteAttachment(resourceGroupName, edgeActionName, body).getFinalResult(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, + Context context) { + beginDeleteAttachment(resourceGroupName, edgeActionName, body, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsImpl.java new file mode 100644 index 000000000000..df7ef2df4d60 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachmentResponse; +import com.azure.resourcemanager.edgeactions.models.EdgeActions; + +public final class EdgeActionsImpl implements EdgeActions { + private static final ClientLogger LOGGER = new ClientLogger(EdgeActionsImpl.class); + + private final EdgeActionsClient innerClient; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + public EdgeActionsImpl(EdgeActionsClient innerClient, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String edgeActionName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, edgeActionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EdgeActionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EdgeAction getByResourceGroup(String resourceGroupName, String edgeActionName) { + EdgeActionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, edgeActionName); + if (inner != null) { + return new EdgeActionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String edgeActionName) { + this.serviceClient().delete(resourceGroupName, edgeActionName); + } + + public void delete(String resourceGroupName, String edgeActionName, Context context) { + this.serviceClient().delete(resourceGroupName, edgeActionName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EdgeActionImpl(inner1, this.manager())); + } + + public EdgeActionAttachmentResponse addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body) { + EdgeActionAttachmentResponseInner inner + = this.serviceClient().addAttachment(resourceGroupName, edgeActionName, body); + if (inner != null) { + return new EdgeActionAttachmentResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public EdgeActionAttachmentResponse addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context) { + EdgeActionAttachmentResponseInner inner + = this.serviceClient().addAttachment(resourceGroupName, edgeActionName, body, context); + if (inner != null) { + return new EdgeActionAttachmentResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body) { + this.serviceClient().deleteAttachment(resourceGroupName, edgeActionName, body); + } + + public void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, + Context context) { + this.serviceClient().deleteAttachment(resourceGroupName, edgeActionName, body, context); + } + + public EdgeAction getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, edgeActionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, edgeActionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + this.delete(resourceGroupName, edgeActionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String edgeActionName = ResourceManagerUtils.getValueFromIdByName(id, "edgeActions"); + if (edgeActionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'edgeActions'.", id))); + } + this.delete(resourceGroupName, edgeActionName, context); + } + + private EdgeActionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } + + public EdgeActionImpl define(String name) { + return new EdgeActionImpl(name, this.manager()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientBuilder.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientBuilder.java new file mode 100644 index 000000000000..1e8897ff591b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the EdgeActionsManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { EdgeActionsManagementClientImpl.class }) +public final class EdgeActionsManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the EdgeActionsManagementClientBuilder. + */ + public EdgeActionsManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of EdgeActionsManagementClientImpl with the provided parameters. + * + * @return an instance of EdgeActionsManagementClientImpl. + */ + public EdgeActionsManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + EdgeActionsManagementClientImpl client = new EdgeActionsManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientImpl.java new file mode 100644 index 000000000000..cd1230cce578 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient; +import com.azure.resourcemanager.edgeactions.fluent.EdgeActionsManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the EdgeActionsManagementClientImpl type. + */ +@ServiceClient(builder = EdgeActionsManagementClientBuilder.class) +public final class EdgeActionsManagementClientImpl implements EdgeActionsManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + 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. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The EdgeActionsClient object to access its operations. + */ + private final EdgeActionsClient edgeActions; + + /** + * Gets the EdgeActionsClient object to access its operations. + * + * @return the EdgeActionsClient object. + */ + public EdgeActionsClient getEdgeActions() { + return this.edgeActions; + } + + /** + * The EdgeActionVersionsClient object to access its operations. + */ + private final EdgeActionVersionsClient edgeActionVersions; + + /** + * Gets the EdgeActionVersionsClient object to access its operations. + * + * @return the EdgeActionVersionsClient object. + */ + public EdgeActionVersionsClient getEdgeActionVersions() { + return this.edgeActionVersions; + } + + /** + * The EdgeActionExecutionFiltersClient object to access its operations. + */ + private final EdgeActionExecutionFiltersClient edgeActionExecutionFilters; + + /** + * Gets the EdgeActionExecutionFiltersClient object to access its operations. + * + * @return the EdgeActionExecutionFiltersClient object. + */ + public EdgeActionExecutionFiltersClient getEdgeActionExecutionFilters() { + return this.edgeActionExecutionFilters; + } + + /** + * Initializes an instance of EdgeActionsManagementClient 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. + */ + EdgeActionsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-09-01-preview"; + this.edgeActions = new EdgeActionsClientImpl(this); + this.edgeActionVersions = new EdgeActionVersionsClientImpl(this); + this.edgeActionExecutionFilters = new EdgeActionExecutionFiltersClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(EdgeActionsManagementClientImpl.class); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/ResourceManagerUtils.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..69b623468cfd --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/VersionCodeImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/VersionCodeImpl.java new file mode 100644 index 000000000000..45a10b4822e0 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/VersionCodeImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation; + +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import com.azure.resourcemanager.edgeactions.models.VersionCode; + +public final class VersionCodeImpl implements VersionCode { + private VersionCodeInner innerObject; + + private final com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager; + + VersionCodeImpl(VersionCodeInner innerObject, + com.azure.resourcemanager.edgeactions.EdgeActionsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String content() { + return this.innerModel().content(); + } + + public String name() { + return this.innerModel().name(); + } + + public VersionCodeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.edgeactions.EdgeActionsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionExecutionFilterListResult.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionExecutionFilterListResult.java new file mode 100644 index 000000000000..5f73ab416d95 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionExecutionFilterListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EdgeActionExecutionFilter list operation. + */ +@Immutable +public final class EdgeActionExecutionFilterListResult + implements JsonSerializable { + /* + * The EdgeActionExecutionFilter items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EdgeActionExecutionFilterListResult class. + */ + private EdgeActionExecutionFilterListResult() { + } + + /** + * Get the value property: The EdgeActionExecutionFilter 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; + } + + /** + * {@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 EdgeActionExecutionFilterListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionExecutionFilterListResult 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 EdgeActionExecutionFilterListResult. + */ + public static EdgeActionExecutionFilterListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionExecutionFilterListResult deserializedEdgeActionExecutionFilterListResult + = new EdgeActionExecutionFilterListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EdgeActionExecutionFilterInner.fromJson(reader1)); + deserializedEdgeActionExecutionFilterListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEdgeActionExecutionFilterListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionExecutionFilterListResult; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionListResult.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionListResult.java new file mode 100644 index 000000000000..22bb965bfe2b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EdgeAction list operation. + */ +@Immutable +public final class EdgeActionListResult implements JsonSerializable { + /* + * The EdgeAction items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EdgeActionListResult class. + */ + private EdgeActionListResult() { + } + + /** + * Get the value property: The EdgeAction 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; + } + + /** + * {@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 EdgeActionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionListResult 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 EdgeActionListResult. + */ + public static EdgeActionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionListResult deserializedEdgeActionListResult = new EdgeActionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> EdgeActionInner.fromJson(reader1)); + deserializedEdgeActionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEdgeActionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionListResult; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionVersionListResult.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionVersionListResult.java new file mode 100644 index 000000000000..5cdde5308a75 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionVersionListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a EdgeActionVersion list operation. + */ +@Immutable +public final class EdgeActionVersionListResult implements JsonSerializable { + /* + * The EdgeActionVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of EdgeActionVersionListResult class. + */ + private EdgeActionVersionListResult() { + } + + /** + * Get the value property: The EdgeActionVersion 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; + } + + /** + * {@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 EdgeActionVersionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionVersionListResult 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 EdgeActionVersionListResult. + */ + public static EdgeActionVersionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionVersionListResult deserializedEdgeActionVersionListResult = new EdgeActionVersionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EdgeActionVersionInner.fromJson(reader1)); + deserializedEdgeActionVersionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEdgeActionVersionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionVersionListResult; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/package-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/package-info.java new file mode 100644 index 000000000000..00eeb4b76016 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for EdgeActionsManagementClient. + */ +package com.azure.resourcemanager.edgeactions.implementation; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeAction.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeAction.java new file mode 100644 index 000000000000..38b98917a64b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeAction.java @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import java.util.Map; + +/** + * An immutable client-side representation of EdgeAction. + */ +public interface EdgeAction { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EdgeActionProperties properties(); + + /** + * Gets the sku property: The sku type of the edge action. + * + * @return the sku value. + */ + SkuType sku(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner object. + * + * @return the inner object. + */ + EdgeActionInner innerModel(); + + /** + * The entirety of the EdgeAction definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * The EdgeAction definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EdgeAction definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EdgeAction definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the EdgeAction definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the EdgeAction definition allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The sku type of the edge action. + * + * @param sku The sku type of the edge action. + * @return the next definition stage. + */ + WithCreate withSku(SkuType sku); + } + + /** + * The stage of the EdgeAction definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EdgeAction create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EdgeAction create(Context context); + } + + /** + * The stage of the EdgeAction definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EdgeAction definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EdgeActionProperties properties); + } + } + + /** + * Begins update for the EdgeAction resource. + * + * @return the stage of resource update. + */ + EdgeAction.Update update(); + + /** + * The template for EdgeAction update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EdgeAction apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EdgeAction apply(Context context); + } + + /** + * The EdgeAction update stages. + */ + interface UpdateStages { + /** + * The stage of the EdgeAction update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the EdgeAction update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(EdgeActionProperties properties); + } + + /** + * The stage of the EdgeAction update allowing to specify sku. + */ + interface WithSku { + /** + * Specifies the sku property: The sku type of the edge action. + * + * @param sku The sku type of the edge action. + * @return the next definition stage. + */ + Update withSku(SkuType sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EdgeAction refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EdgeAction refresh(Context context); + + /** + * A long-running resource action. + * + * @param body 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 response. + */ + EdgeActionAttachmentResponse addAttachment(EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param body 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 response. + */ + EdgeActionAttachmentResponse addAttachment(EdgeActionAttachment body, Context context); + + /** + * A long-running resource action. + * + * @param body 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. + */ + void deleteAttachment(EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param body 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. + */ + void deleteAttachment(EdgeActionAttachment body, Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachment.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachment.java new file mode 100644 index 000000000000..311b1da993be --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachment.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.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; + +/** + * Edge action attachment information. + */ +@Fluent +public final class EdgeActionAttachment implements JsonSerializable { + /* + * The edge action attachment id + */ + private String id; + + /* + * The attached resource Id + */ + private String attachedResourceId; + + /** + * Creates an instance of EdgeActionAttachment class. + */ + public EdgeActionAttachment() { + } + + /** + * Get the id property: The edge action attachment id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the attachedResourceId property: The attached resource Id. + * + * @return the attachedResourceId value. + */ + public String attachedResourceId() { + return this.attachedResourceId; + } + + /** + * Set the attachedResourceId property: The attached resource Id. + * + * @param attachedResourceId the attachedResourceId value to set. + * @return the EdgeActionAttachment object itself. + */ + public EdgeActionAttachment withAttachedResourceId(String attachedResourceId) { + this.attachedResourceId = attachedResourceId; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attachedResourceId", this.attachedResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionAttachment 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 EdgeActionAttachment. + */ + public static EdgeActionAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionAttachment deserializedEdgeActionAttachment = new EdgeActionAttachment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEdgeActionAttachment.id = reader.getString(); + } else if ("attachedResourceId".equals(fieldName)) { + deserializedEdgeActionAttachment.attachedResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionAttachment; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachmentResponse.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachmentResponse.java new file mode 100644 index 000000000000..b226c6c3c729 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachmentResponse.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.edgeactions.models; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; + +/** + * An immutable client-side representation of EdgeActionAttachmentResponse. + */ +public interface EdgeActionAttachmentResponse { + /** + * Gets the edgeActionId property: Non changing guid to identity edge action. + * + * @return the edgeActionId value. + */ + String edgeActionId(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner object. + * + * @return the inner object. + */ + EdgeActionAttachmentResponseInner innerModel(); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilter.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilter.java new file mode 100644 index 000000000000..08be45085ed6 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilter.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import java.util.Map; + +/** + * An immutable client-side representation of EdgeActionExecutionFilter. + */ +public interface EdgeActionExecutionFilter { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EdgeActionExecutionFilterProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner object. + * + * @return the inner object. + */ + EdgeActionExecutionFilterInner innerModel(); + + /** + * The entirety of the EdgeActionExecutionFilter definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The EdgeActionExecutionFilter definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EdgeActionExecutionFilter definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EdgeActionExecutionFilter definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the EdgeActionExecutionFilter definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, edgeActionName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @return the next definition stage. + */ + WithCreate withExistingEdgeAction(String resourceGroupName, String edgeActionName); + } + + /** + * The stage of the EdgeActionExecutionFilter definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EdgeActionExecutionFilter create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EdgeActionExecutionFilter create(Context context); + } + + /** + * The stage of the EdgeActionExecutionFilter definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EdgeActionExecutionFilter definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EdgeActionExecutionFilterProperties properties); + } + } + + /** + * Begins update for the EdgeActionExecutionFilter resource. + * + * @return the stage of resource update. + */ + EdgeActionExecutionFilter.Update update(); + + /** + * The template for EdgeActionExecutionFilter update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EdgeActionExecutionFilter apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EdgeActionExecutionFilter apply(Context context); + } + + /** + * The EdgeActionExecutionFilter update stages. + */ + interface UpdateStages { + /** + * The stage of the EdgeActionExecutionFilter update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the EdgeActionExecutionFilter update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(EdgeActionExecutionFilterProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EdgeActionExecutionFilter refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EdgeActionExecutionFilter refresh(Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilterProperties.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilterProperties.java new file mode 100644 index 000000000000..f4c2f32b2716 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilterProperties.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.annotation.Fluent; +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 java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties for edge action execution filter. + */ +@Fluent +public final class EdgeActionExecutionFilterProperties + implements JsonSerializable { + /* + * The referenced versionId of the edgeaction version + */ + private String versionId; + + /* + * The last update time in UTC for the execution filter + */ + private OffsetDateTime lastUpdateTime; + + /* + * Custom Header Key associated with the execution filter + */ + private String executionFilterIdentifierHeaderName; + + /* + * Custom Header Value associated with the execution filter + */ + private String executionFilterIdentifierHeaderValue; + + /* + * The provisioning state + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of EdgeActionExecutionFilterProperties class. + */ + public EdgeActionExecutionFilterProperties() { + } + + /** + * Get the versionId property: The referenced versionId of the edgeaction version. + * + * @return the versionId value. + */ + public String versionId() { + return this.versionId; + } + + /** + * Set the versionId property: The referenced versionId of the edgeaction version. + * + * @param versionId the versionId value to set. + * @return the EdgeActionExecutionFilterProperties object itself. + */ + public EdgeActionExecutionFilterProperties withVersionId(String versionId) { + this.versionId = versionId; + return this; + } + + /** + * Get the lastUpdateTime property: The last update time in UTC for the execution filter. + * + * @return the lastUpdateTime value. + */ + public OffsetDateTime lastUpdateTime() { + return this.lastUpdateTime; + } + + /** + * Get the executionFilterIdentifierHeaderName property: Custom Header Key associated with the execution filter. + * + * @return the executionFilterIdentifierHeaderName value. + */ + public String executionFilterIdentifierHeaderName() { + return this.executionFilterIdentifierHeaderName; + } + + /** + * Set the executionFilterIdentifierHeaderName property: Custom Header Key associated with the execution filter. + * + * @param executionFilterIdentifierHeaderName the executionFilterIdentifierHeaderName value to set. + * @return the EdgeActionExecutionFilterProperties object itself. + */ + public EdgeActionExecutionFilterProperties + withExecutionFilterIdentifierHeaderName(String executionFilterIdentifierHeaderName) { + this.executionFilterIdentifierHeaderName = executionFilterIdentifierHeaderName; + return this; + } + + /** + * Get the executionFilterIdentifierHeaderValue property: Custom Header Value associated with the execution filter. + * + * @return the executionFilterIdentifierHeaderValue value. + */ + public String executionFilterIdentifierHeaderValue() { + return this.executionFilterIdentifierHeaderValue; + } + + /** + * Set the executionFilterIdentifierHeaderValue property: Custom Header Value associated with the execution filter. + * + * @param executionFilterIdentifierHeaderValue the executionFilterIdentifierHeaderValue value to set. + * @return the EdgeActionExecutionFilterProperties object itself. + */ + public EdgeActionExecutionFilterProperties + withExecutionFilterIdentifierHeaderValue(String executionFilterIdentifierHeaderValue) { + this.executionFilterIdentifierHeaderValue = executionFilterIdentifierHeaderValue; + return this; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("versionId", this.versionId); + jsonWriter.writeStringField("executionFilterIdentifierHeaderName", this.executionFilterIdentifierHeaderName); + jsonWriter.writeStringField("executionFilterIdentifierHeaderValue", this.executionFilterIdentifierHeaderValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionExecutionFilterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionExecutionFilterProperties 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 EdgeActionExecutionFilterProperties. + */ + public static EdgeActionExecutionFilterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionExecutionFilterProperties deserializedEdgeActionExecutionFilterProperties + = new EdgeActionExecutionFilterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("versionId".equals(fieldName)) { + deserializedEdgeActionExecutionFilterProperties.versionId = reader.getString(); + } else if ("lastUpdateTime".equals(fieldName)) { + deserializedEdgeActionExecutionFilterProperties.lastUpdateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("executionFilterIdentifierHeaderName".equals(fieldName)) { + deserializedEdgeActionExecutionFilterProperties.executionFilterIdentifierHeaderName + = reader.getString(); + } else if ("executionFilterIdentifierHeaderValue".equals(fieldName)) { + deserializedEdgeActionExecutionFilterProperties.executionFilterIdentifierHeaderValue + = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedEdgeActionExecutionFilterProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionExecutionFilterProperties; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilters.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilters.java new file mode 100644 index 000000000000..8da82c3ef22d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilters.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EdgeActionExecutionFilters. + */ +public interface EdgeActionExecutionFilters { + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String edgeActionName, + String executionFilter, Context context); + + /** + * Get a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter. + */ + EdgeActionExecutionFilter get(String resourceGroupName, String edgeActionName, String executionFilter); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String edgeActionName, String executionFilter); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param executionFilter The name of the execution filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String edgeActionName, String executionFilter, Context context); + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName); + + /** + * List EdgeActionExecutionFilter resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionExecutionFilter list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, + Context context); + + /** + * Get a EdgeActionExecutionFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response}. + */ + EdgeActionExecutionFilter getById(String id); + + /** + * Get a EdgeActionExecutionFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionExecutionFilter along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EdgeActionExecutionFilter. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EdgeActionExecutionFilter resource. + * + * @param name resource name. + * @return the first stage of the new EdgeActionExecutionFilter definition. + */ + EdgeActionExecutionFilter.DefinitionStages.Blank define(String name); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionIsDefaultVersion.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionIsDefaultVersion.java new file mode 100644 index 000000000000..6e3ef21be645 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionIsDefaultVersion.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.edgeactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates whether this is the default version. + */ +public final class EdgeActionIsDefaultVersion extends ExpandableStringEnum { + /** + * This is the default version. + */ + public static final EdgeActionIsDefaultVersion TRUE = fromString("True"); + + /** + * This is not the default version. + */ + public static final EdgeActionIsDefaultVersion FALSE = fromString("False"); + + /** + * Creates a new instance of EdgeActionIsDefaultVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EdgeActionIsDefaultVersion() { + } + + /** + * Creates or finds a EdgeActionIsDefaultVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding EdgeActionIsDefaultVersion. + */ + public static EdgeActionIsDefaultVersion fromString(String name) { + return fromString(name, EdgeActionIsDefaultVersion.class); + } + + /** + * Gets known EdgeActionIsDefaultVersion values. + * + * @return known EdgeActionIsDefaultVersion values. + */ + public static Collection values() { + return values(EdgeActionIsDefaultVersion.class); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionProperties.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionProperties.java new file mode 100644 index 000000000000..491a821f79d2 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents an edge action properties. + */ +@Immutable +public final class EdgeActionProperties implements JsonSerializable { + /* + * The provisioning state of the edge action + */ + private ProvisioningState provisioningState; + + /* + * A list of attachments for the edge action + */ + private List attachments; + + /** + * Creates an instance of EdgeActionProperties class. + */ + public EdgeActionProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the edge action. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the attachments property: A list of attachments for the edge action. + * + * @return the attachments value. + */ + public List attachments() { + return this.attachments; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EdgeActionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EdgeActionProperties 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 EdgeActionProperties. + */ + public static EdgeActionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EdgeActionProperties deserializedEdgeActionProperties = new EdgeActionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attachments".equals(fieldName)) { + List attachments + = reader.readArray(reader1 -> EdgeActionAttachment.fromJson(reader1)); + deserializedEdgeActionProperties.attachments = attachments; + } else if ("provisioningState".equals(fieldName)) { + deserializedEdgeActionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEdgeActionProperties; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java new file mode 100644 index 000000000000..a2e671804c47 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import java.util.Map; + +/** + * An immutable client-side representation of EdgeActionVersion. + */ +public interface EdgeActionVersion { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + EdgeActionVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner object. + * + * @return the inner object. + */ + EdgeActionVersionInner innerModel(); + + /** + * The entirety of the EdgeActionVersion definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The EdgeActionVersion definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the EdgeActionVersion definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the EdgeActionVersion definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the EdgeActionVersion definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, edgeActionName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @return the next definition stage. + */ + WithCreate withExistingEdgeAction(String resourceGroupName, String edgeActionName); + } + + /** + * The stage of the EdgeActionVersion definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + EdgeActionVersion create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EdgeActionVersion create(Context context); + } + + /** + * The stage of the EdgeActionVersion definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the EdgeActionVersion definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(EdgeActionVersionPropertiesInner properties); + } + } + + /** + * Begins update for the EdgeActionVersion resource. + * + * @return the stage of resource update. + */ + EdgeActionVersion.Update update(); + + /** + * The template for EdgeActionVersion update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EdgeActionVersion apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EdgeActionVersion apply(Context context); + } + + /** + * The EdgeActionVersion update stages. + */ + interface UpdateStages { + /** + * The stage of the EdgeActionVersion update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the EdgeActionVersion update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(EdgeActionVersionPropertiesInner properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EdgeActionVersion refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EdgeActionVersion refresh(Context context); + + /** + * A long-running resource action. + * + * @param body 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 response. + */ + EdgeActionVersionProperties deployVersionCode(VersionCodeInner body); + + /** + * A long-running resource action. + * + * @param body 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 response. + */ + EdgeActionVersionProperties deployVersionCode(VersionCodeInner body, Context context); + + /** + * A long-running resource action. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + VersionCode getVersionCode(); + + /** + * A long-running resource action. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + VersionCode getVersionCode(Context context); + + /** + * A long-running resource action. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapDefault(); + + /** + * A long-running resource action. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapDefault(Context context); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionDeploymentType.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionDeploymentType.java new file mode 100644 index 000000000000..c0950f8b6cab --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionDeploymentType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The deployment type for edge action versions. + */ +public final class EdgeActionVersionDeploymentType extends ExpandableStringEnum { + /** + * ZIP file deployment. + */ + public static final EdgeActionVersionDeploymentType ZIP = fromString("zip"); + + /** + * Single file deployment. + */ + public static final EdgeActionVersionDeploymentType FILE = fromString("file"); + + /** + * Other deployment types. + */ + public static final EdgeActionVersionDeploymentType OTHERS = fromString("others"); + + /** + * Creates a new instance of EdgeActionVersionDeploymentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EdgeActionVersionDeploymentType() { + } + + /** + * Creates or finds a EdgeActionVersionDeploymentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EdgeActionVersionDeploymentType. + */ + public static EdgeActionVersionDeploymentType fromString(String name) { + return fromString(name, EdgeActionVersionDeploymentType.class); + } + + /** + * Gets known EdgeActionVersionDeploymentType values. + * + * @return known EdgeActionVersionDeploymentType values. + */ + public static Collection values() { + return values(EdgeActionVersionDeploymentType.class); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionProperties.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionProperties.java new file mode 100644 index 000000000000..f6402d5c53f5 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import java.time.OffsetDateTime; + +/** + * An immutable client-side representation of EdgeActionVersionProperties. + */ +public interface EdgeActionVersionProperties { + /** + * Gets the deploymentType property: The deployment type. + * + * @return the deploymentType value. + */ + EdgeActionVersionDeploymentType deploymentType(); + + /** + * Gets the validationStatus property: The validation status. + * + * @return the validationStatus value. + */ + EdgeActionVersionValidationStatus validationStatus(); + + /** + * Gets the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the isDefaultVersion property: The active state. + * + * @return the isDefaultVersion value. + */ + EdgeActionIsDefaultVersion isDefaultVersion(); + + /** + * Gets the lastPackageUpdateTime property: The last update time in UTC for package update. + * + * @return the lastPackageUpdateTime value. + */ + OffsetDateTime lastPackageUpdateTime(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner object. + * + * @return the inner object. + */ + EdgeActionVersionPropertiesInner innerModel(); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionValidationStatus.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionValidationStatus.java new file mode 100644 index 000000000000..e3d587d88fed --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionValidationStatus.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.edgeactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The validation status for edge action versions. + */ +public final class EdgeActionVersionValidationStatus extends ExpandableStringEnum { + /** + * Validation succeeded. + */ + public static final EdgeActionVersionValidationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Validation failed. + */ + public static final EdgeActionVersionValidationStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of EdgeActionVersionValidationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EdgeActionVersionValidationStatus() { + } + + /** + * Creates or finds a EdgeActionVersionValidationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EdgeActionVersionValidationStatus. + */ + public static EdgeActionVersionValidationStatus fromString(String name) { + return fromString(name, EdgeActionVersionValidationStatus.class); + } + + /** + * Gets known EdgeActionVersionValidationStatus values. + * + * @return known EdgeActionVersionValidationStatus values. + */ + public static Collection values() { + return values(EdgeActionVersionValidationStatus.class); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java new file mode 100644 index 000000000000..24a7cd67b82b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; + +/** + * Resource collection API of EdgeActionVersions. + */ +public interface EdgeActionVersions { + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String edgeActionName, String version, + Context context); + + /** + * Get a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion. + */ + EdgeActionVersion get(String resourceGroupName, String edgeActionName, String version); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String edgeActionName, String version); + + /** + * Delete a EdgeActionVersion. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String edgeActionName, String version, Context context); + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName); + + /** + * List EdgeActionVersion resources by EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeActionVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String edgeActionName, String version, + VersionCodeInner body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param body 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 response. + */ + EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String edgeActionName, String version, + VersionCodeInner body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + VersionCode getVersionCode(String resourceGroupName, String edgeActionName, String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + VersionCode getVersionCode(String resourceGroupName, String edgeActionName, String version, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapDefault(String resourceGroupName, String edgeActionName, String version); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param version The name of the Edge Action version. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void swapDefault(String resourceGroupName, String edgeActionName, String version, Context context); + + /** + * Get a EdgeActionVersion. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response}. + */ + EdgeActionVersion getById(String id); + + /** + * Get a EdgeActionVersion. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeActionVersion along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EdgeActionVersion. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EdgeActionVersion. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EdgeActionVersion resource. + * + * @param name resource name. + * @return the first stage of the new EdgeActionVersion definition. + */ + EdgeActionVersion.DefinitionStages.Blank define(String name); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActions.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActions.java new file mode 100644 index 000000000000..361d77adc287 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActions.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of EdgeActions. + */ +public interface EdgeActions { + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String edgeActionName, + Context context); + + /** + * Get a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction. + */ + EdgeAction getByResourceGroup(String resourceGroupName, String edgeActionName); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String edgeActionName); + + /** + * Delete a EdgeAction. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String edgeActionName, Context context); + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List EdgeAction resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List EdgeAction resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List EdgeAction resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a EdgeAction list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + EdgeActionAttachmentResponse addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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 response. + */ + EdgeActionAttachmentResponse addAttachment(String resourceGroupName, String edgeActionName, + EdgeActionAttachment body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param edgeActionName The name of the Edge Action. + * @param body 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. + */ + void deleteAttachment(String resourceGroupName, String edgeActionName, EdgeActionAttachment body, Context context); + + /** + * Get a EdgeAction. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response}. + */ + EdgeAction getById(String id); + + /** + * Get a EdgeAction. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a EdgeAction along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a EdgeAction. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a EdgeAction. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EdgeAction resource. + * + * @param name resource name. + * @return the first stage of the new EdgeAction definition. + */ + EdgeAction.DefinitionStages.Blank define(String name); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/ProvisioningState.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/ProvisioningState.java new file mode 100644 index 000000000000..3c75c482715e --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/ProvisioningState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the current operation. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Initial provisioning in progress. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Upgrade in progress. + */ + public static final ProvisioningState UPGRADING = fromString("Upgrading"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/SkuType.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/SkuType.java new file mode 100644 index 000000000000..569afe95b986 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/SkuType.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The SKU type for the edge action. + */ +@Fluent +public final class SkuType implements JsonSerializable { + /* + * The name of the SKU + */ + private String name; + + /* + * The tier of the SKU + */ + private String tier; + + /** + * Creates an instance of SkuType class. + */ + public SkuType() { + } + + /** + * Get the name property: The name of the SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. + * + * @param name the name value to set. + * @return the SkuType object itself. + */ + public SkuType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of the SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of the SKU. + * + * @param tier the tier value to set. + * @return the SkuType object itself. + */ + public SkuType withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("tier", this.tier); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuType 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 SkuType. + */ + public static SkuType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuType deserializedSkuType = new SkuType(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuType.name = reader.getString(); + } else if ("tier".equals(fieldName)) { + deserializedSkuType.tier = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuType; + }); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/VersionCode.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/VersionCode.java new file mode 100644 index 000000000000..88e320b6541a --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/VersionCode.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.edgeactions.models; + +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; + +/** + * An immutable client-side representation of VersionCode. + */ +public interface VersionCode { + /** + * Gets the content property: The version code deployment content. + * + * @return the content value. + */ + String content(); + + /** + * Gets the name property: The version code name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner object. + * + * @return the inner object. + */ + VersionCodeInner innerModel(); +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/package-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/package-info.java new file mode 100644 index 000000000000..988b99434837 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for EdgeActionsManagementClient. + */ +package com.azure.resourcemanager.edgeactions.models; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/package-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/package-info.java new file mode 100644 index 000000000000..e8a9ab85b357 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for EdgeActionsManagementClient. + */ +package com.azure.resourcemanager.edgeactions; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/module-info.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/module-info.java new file mode 100644 index 000000000000..0157efd3ae33 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.edgeactions { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.edgeactions; + exports com.azure.resourcemanager.edgeactions.fluent; + exports com.azure.resourcemanager.edgeactions.fluent.models; + exports com.azure.resourcemanager.edgeactions.models; + + opens com.azure.resourcemanager.edgeactions.fluent.models to com.azure.core; + opens com.azure.resourcemanager.edgeactions.models to com.azure.core; + opens com.azure.resourcemanager.edgeactions.implementation.models to com.azure.core; +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_apiview_properties.json b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_apiview_properties.json new file mode 100644 index 000000000000..8c30e67be0b9 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_apiview_properties.json @@ -0,0 +1,65 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient": "Microsoft.Cdn.EdgeActionExecutionFilters", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginCreate": "Microsoft.Cdn.EdgeActionExecutionFilters.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginDelete": "Microsoft.Cdn.EdgeActionExecutionFilters.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginUpdate": "Microsoft.Cdn.EdgeActionExecutionFilters.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.create": "Microsoft.Cdn.EdgeActionExecutionFilters.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.delete": "Microsoft.Cdn.EdgeActionExecutionFilters.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.get": "Microsoft.Cdn.EdgeActionExecutionFilters.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.getWithResponse": "Microsoft.Cdn.EdgeActionExecutionFilters.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.listByEdgeAction": "Microsoft.Cdn.EdgeActionExecutionFilters.listByEdgeAction", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.update": "Microsoft.Cdn.EdgeActionExecutionFilters.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient": "Microsoft.Cdn.EdgeActionVersions", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginCreate": "Microsoft.Cdn.EdgeActionVersions.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginDelete": "Microsoft.Cdn.EdgeActionVersions.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginDeployVersionCode": "Microsoft.Cdn.EdgeActionVersions.deployVersionCode", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginGetVersionCode": "Microsoft.Cdn.EdgeActionVersions.getVersionCode", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginSwapDefault": "Microsoft.Cdn.EdgeActionVersions.swapDefault", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginUpdate": "Microsoft.Cdn.EdgeActionVersions.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.create": "Microsoft.Cdn.EdgeActionVersions.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.delete": "Microsoft.Cdn.EdgeActionVersions.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.deployVersionCode": "Microsoft.Cdn.EdgeActionVersions.deployVersionCode", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.get": "Microsoft.Cdn.EdgeActionVersions.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.getVersionCode": "Microsoft.Cdn.EdgeActionVersions.getVersionCode", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.getWithResponse": "Microsoft.Cdn.EdgeActionVersions.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.listByEdgeAction": "Microsoft.Cdn.EdgeActionVersions.listByEdgeAction", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.swapDefault": "Microsoft.Cdn.EdgeActionVersions.swapDefault", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.update": "Microsoft.Cdn.EdgeActionVersions.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient": "Microsoft.Cdn.EdgeActions", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.addAttachment": "Microsoft.Cdn.EdgeActions.addAttachment", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginAddAttachment": "Microsoft.Cdn.EdgeActions.addAttachment", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginCreate": "Microsoft.Cdn.EdgeActions.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginDelete": "Microsoft.Cdn.EdgeActions.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginDeleteAttachment": "Microsoft.Cdn.EdgeActions.deleteAttachment", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginUpdate": "Microsoft.Cdn.EdgeActions.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.create": "Microsoft.Cdn.EdgeActions.create", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.delete": "Microsoft.Cdn.EdgeActions.delete", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.deleteAttachment": "Microsoft.Cdn.EdgeActions.deleteAttachment", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.getByResourceGroup": "Microsoft.Cdn.EdgeActions.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.getByResourceGroupWithResponse": "Microsoft.Cdn.EdgeActions.get", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.list": "Microsoft.Cdn.EdgeActions.listBySubscription", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.listByResourceGroup": "Microsoft.Cdn.EdgeActions.listByResourceGroup", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.update": "Microsoft.Cdn.EdgeActions.update", + "com.azure.resourcemanager.edgeactions.fluent.EdgeActionsManagementClient": "Microsoft.Cdn", + "com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner": "Microsoft.Cdn.EdgeActionAttachmentResponse", + "com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner": "Microsoft.Cdn.EdgeActionExecutionFilter", + "com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner": "Microsoft.Cdn.EdgeAction", + "com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner": "Microsoft.Cdn.EdgeActionVersion", + "com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner": "Microsoft.Cdn.EdgeActionVersionProperties", + "com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner": "Microsoft.Cdn.VersionCode", + "com.azure.resourcemanager.edgeactions.implementation.EdgeActionsManagementClientBuilder": "Microsoft.Cdn", + "com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionExecutionFilterListResult": "Azure.ResourceManager.ResourceListResult", + "com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionListResult": "Azure.ResourceManager.ResourceListResult", + "com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionVersionListResult": "Azure.ResourceManager.ResourceListResult", + "com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment": "Microsoft.Cdn.EdgeActionAttachment", + "com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties": "Microsoft.Cdn.EdgeActionExecutionFilterProperties", + "com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion": "Microsoft.Cdn.EdgeActionIsDefaultVersion", + "com.azure.resourcemanager.edgeactions.models.EdgeActionProperties": "Microsoft.Cdn.EdgeActionProperties", + "com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType": "Microsoft.Cdn.EdgeActionVersionDeploymentType", + "com.azure.resourcemanager.edgeactions.models.EdgeActionVersionValidationStatus": "Microsoft.Cdn.EdgeActionVersionValidationStatus", + "com.azure.resourcemanager.edgeactions.models.ProvisioningState": "Microsoft.Cdn.ProvisioningState", + "com.azure.resourcemanager.edgeactions.models.SkuType": "Microsoft.Cdn.SkuType" + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_metadata.json b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_metadata.json new file mode 100644 index 000000000000..b5401760c26d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/azure-resourcemanager-edgeactions_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"2025-09-01-preview","crossLanguageDefinitions":{"com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient":"Microsoft.Cdn.EdgeActionExecutionFilters","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginCreate":"Microsoft.Cdn.EdgeActionExecutionFilters.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginDelete":"Microsoft.Cdn.EdgeActionExecutionFilters.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.beginUpdate":"Microsoft.Cdn.EdgeActionExecutionFilters.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.create":"Microsoft.Cdn.EdgeActionExecutionFilters.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.delete":"Microsoft.Cdn.EdgeActionExecutionFilters.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.get":"Microsoft.Cdn.EdgeActionExecutionFilters.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.getWithResponse":"Microsoft.Cdn.EdgeActionExecutionFilters.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.listByEdgeAction":"Microsoft.Cdn.EdgeActionExecutionFilters.listByEdgeAction","com.azure.resourcemanager.edgeactions.fluent.EdgeActionExecutionFiltersClient.update":"Microsoft.Cdn.EdgeActionExecutionFilters.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient":"Microsoft.Cdn.EdgeActionVersions","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginCreate":"Microsoft.Cdn.EdgeActionVersions.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginDelete":"Microsoft.Cdn.EdgeActionVersions.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginDeployVersionCode":"Microsoft.Cdn.EdgeActionVersions.deployVersionCode","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginGetVersionCode":"Microsoft.Cdn.EdgeActionVersions.getVersionCode","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginSwapDefault":"Microsoft.Cdn.EdgeActionVersions.swapDefault","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.beginUpdate":"Microsoft.Cdn.EdgeActionVersions.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.create":"Microsoft.Cdn.EdgeActionVersions.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.delete":"Microsoft.Cdn.EdgeActionVersions.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.deployVersionCode":"Microsoft.Cdn.EdgeActionVersions.deployVersionCode","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.get":"Microsoft.Cdn.EdgeActionVersions.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.getVersionCode":"Microsoft.Cdn.EdgeActionVersions.getVersionCode","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.getWithResponse":"Microsoft.Cdn.EdgeActionVersions.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.listByEdgeAction":"Microsoft.Cdn.EdgeActionVersions.listByEdgeAction","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.swapDefault":"Microsoft.Cdn.EdgeActionVersions.swapDefault","com.azure.resourcemanager.edgeactions.fluent.EdgeActionVersionsClient.update":"Microsoft.Cdn.EdgeActionVersions.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient":"Microsoft.Cdn.EdgeActions","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.addAttachment":"Microsoft.Cdn.EdgeActions.addAttachment","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginAddAttachment":"Microsoft.Cdn.EdgeActions.addAttachment","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginCreate":"Microsoft.Cdn.EdgeActions.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginDelete":"Microsoft.Cdn.EdgeActions.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginDeleteAttachment":"Microsoft.Cdn.EdgeActions.deleteAttachment","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.beginUpdate":"Microsoft.Cdn.EdgeActions.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.create":"Microsoft.Cdn.EdgeActions.create","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.delete":"Microsoft.Cdn.EdgeActions.delete","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.deleteAttachment":"Microsoft.Cdn.EdgeActions.deleteAttachment","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.getByResourceGroup":"Microsoft.Cdn.EdgeActions.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.getByResourceGroupWithResponse":"Microsoft.Cdn.EdgeActions.get","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.list":"Microsoft.Cdn.EdgeActions.listBySubscription","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.listByResourceGroup":"Microsoft.Cdn.EdgeActions.listByResourceGroup","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsClient.update":"Microsoft.Cdn.EdgeActions.update","com.azure.resourcemanager.edgeactions.fluent.EdgeActionsManagementClient":"Microsoft.Cdn","com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner":"Microsoft.Cdn.EdgeActionAttachmentResponse","com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner":"Microsoft.Cdn.EdgeActionExecutionFilter","com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner":"Microsoft.Cdn.EdgeAction","com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner":"Microsoft.Cdn.EdgeActionVersion","com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner":"Microsoft.Cdn.EdgeActionVersionProperties","com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner":"Microsoft.Cdn.VersionCode","com.azure.resourcemanager.edgeactions.implementation.EdgeActionsManagementClientBuilder":"Microsoft.Cdn","com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionExecutionFilterListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionVersionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment":"Microsoft.Cdn.EdgeActionAttachment","com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties":"Microsoft.Cdn.EdgeActionExecutionFilterProperties","com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion":"Microsoft.Cdn.EdgeActionIsDefaultVersion","com.azure.resourcemanager.edgeactions.models.EdgeActionProperties":"Microsoft.Cdn.EdgeActionProperties","com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType":"Microsoft.Cdn.EdgeActionVersionDeploymentType","com.azure.resourcemanager.edgeactions.models.EdgeActionVersionValidationStatus":"Microsoft.Cdn.EdgeActionVersionValidationStatus","com.azure.resourcemanager.edgeactions.models.ProvisioningState":"Microsoft.Cdn.ProvisioningState","com.azure.resourcemanager.edgeactions.models.SkuType":"Microsoft.Cdn.SkuType"},"generatedFiles":["src/main/java/com/azure/resourcemanager/edgeactions/EdgeActionsManager.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionExecutionFiltersClient.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsClient.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionsManagementClient.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionAttachmentResponseInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionExecutionFilterInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/EdgeActionVersionPropertiesInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/VersionCodeInner.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/edgeactions/fluent/package-info.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionAttachmentResponseImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFilterImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersClientImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionExecutionFiltersImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionPropertiesImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsClientImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/VersionCodeImpl.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionExecutionFilterListResult.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionListResult.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/models/EdgeActionVersionListResult.java","src/main/java/com/azure/resourcemanager/edgeactions/implementation/package-info.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeAction.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachment.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionAttachmentResponse.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilter.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilterProperties.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionExecutionFilters.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionIsDefaultVersion.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionProperties.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionDeploymentType.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionProperties.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersionValidationStatus.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java","src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActions.java","src/main/java/com/azure/resourcemanager/edgeactions/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/edgeactions/models/SkuType.java","src/main/java/com/azure/resourcemanager/edgeactions/models/VersionCode.java","src/main/java/com/azure/resourcemanager/edgeactions/models/package-info.java","src/main/java/com/azure/resourcemanager/edgeactions/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/proxy-config.json b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/proxy-config.json new file mode 100644 index 000000000000..064501fc9965 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.edgeactions.implementation.EdgeActionExecutionFiltersClientImpl$EdgeActionExecutionFiltersService"],["com.azure.resourcemanager.edgeactions.implementation.EdgeActionVersionsClientImpl$EdgeActionVersionsService"],["com.azure.resourcemanager.edgeactions.implementation.EdgeActionsClientImpl$EdgeActionsService"]] \ No newline at end of file diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/reflect-config.json b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-edgeactions/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/azure-resourcemanager-edgeactions.properties b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/azure-resourcemanager-edgeactions.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/resources/azure-resourcemanager-edgeactions.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateSamples.java new file mode 100644 index 000000000000..d82da5d9f191 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; + +/** + * Samples for EdgeActionExecutionFilters Create. + */ +public final class EdgeActionExecutionFiltersCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Create.json + */ + /** + * Sample code: CreateEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + createEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .define("executionFilter1") + .withRegion("global") + .withExistingEdgeAction("testrg", "edgeAction1") + .withProperties(new EdgeActionExecutionFilterProperties().withVersionId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/Microsoft.Cdn/EdgeActions/edgeAction1/versions/version1") + .withExecutionFilterIdentifierHeaderName("header-key") + .withExecutionFilterIdentifierHeaderValue("header-value")) + .create(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersDeleteSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersDeleteSamples.java new file mode 100644 index 000000000000..c01bf2cbf639 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersDeleteSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionExecutionFilters Delete. + */ +public final class EdgeActionExecutionFiltersDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Delete.json + */ + /** + * Sample code: DeleteEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + deleteEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .delete("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetSamples.java new file mode 100644 index 000000000000..ff459cba5546 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionExecutionFilters Get. + */ +public final class EdgeActionExecutionFiltersGetSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Get.json + */ + /** + * Sample code: GetEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .getWithResponse("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionSamples.java new file mode 100644 index 000000000000..af8679f712e6 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionExecutionFilters ListByEdgeAction. + */ +public final class EdgeActionExecutionFiltersListByEdgeActionSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_ListByEdgeAction.json + */ + /** + * Sample code: ListEdgeActionsExecutionFiltersByEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + listEdgeActionsExecutionFiltersByEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionExecutionFilters() + .listByEdgeAction("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersUpdateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersUpdateSamples.java new file mode 100644 index 000000000000..561108918a84 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; + +/** + * Samples for EdgeActionExecutionFilters Update. + */ +public final class EdgeActionExecutionFiltersUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionExecutionFilters_Update.json + */ + /** + * Sample code: UpdateEdgeActionExecutionFilters. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + updateEdgeActionExecutionFilters(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeActionExecutionFilter resource = manager.edgeActionExecutionFilters() + .getWithResponse("testrg", "edgeAction1", "executionFilter1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new EdgeActionExecutionFilterProperties().withExecutionFilterIdentifierHeaderValue("header-value2")) + .apply(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateSamples.java new file mode 100644 index 000000000000..f1c8f10da9d0 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; + +/** + * Samples for EdgeActionVersions Create. + */ +public final class EdgeActionVersionsCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Create.json + */ + /** + * Sample code: CreateEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void createEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .define("version2") + .withRegion("global") + .withExistingEdgeAction("testrg", "edgeAction1") + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.ZIP) + .withIsDefaultVersion(EdgeActionIsDefaultVersion.TRUE)) + .create(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeleteSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeleteSamples.java new file mode 100644 index 000000000000..79fd2b52b298 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeleteSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionVersions Delete. + */ +public final class EdgeActionVersionsDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Delete.json + */ + /** + * Sample code: DeleteEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().delete("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeSamples.java new file mode 100644 index 000000000000..5e0dd703924b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; + +/** + * Samples for EdgeActionVersions DeployVersionCode. + */ +public final class EdgeActionVersionsDeployVersionCodeSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_DeployVersionCode.json + */ + /** + * Sample code: DeployVersionCode. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deployVersionCode(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .deployVersionCode("testrg", "edgeAction1", "version2", + new VersionCodeInner().withContent("UEsDBBQAAAAIAI1NzkQAAAAABQAAAA==").withName("zippedFile"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetSamples.java new file mode 100644 index 000000000000..6b44d12e63d6 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionVersions Get. + */ +public final class EdgeActionVersionsGetSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Get.json + */ + /** + * Sample code: GetEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .getWithResponse("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeSamples.java new file mode 100644 index 000000000000..9a99892ad0ee --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionVersions GetVersionCode. + */ +public final class EdgeActionVersionsGetVersionCodeSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_GetVersionCode.json + */ + /** + * Sample code: GetVersionCode. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getVersionCode(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions() + .getVersionCode("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionSamples.java new file mode 100644 index 000000000000..cf52f18323d9 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionVersions ListByEdgeAction. + */ +public final class EdgeActionVersionsListByEdgeActionSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_ListByEdgeAction.json + */ + /** + * Sample code: GetEdgeActionVersionsByEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + getEdgeActionVersionsByEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().listByEdgeAction("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsSwapDefaultSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsSwapDefaultSamples.java new file mode 100644 index 000000000000..dfb98daed0d2 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsSwapDefaultSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActionVersions SwapDefault. + */ +public final class EdgeActionVersionsSwapDefaultSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_SwapDefault.json + */ + /** + * Sample code: Swap Default Version. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void swapDefaultVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActionVersions().swapDefault("testrg", "edgeAction1", "1.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsUpdateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsUpdateSamples.java new file mode 100644 index 000000000000..4cca7a19d369 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; + +/** + * Samples for EdgeActionVersions Update. + */ +public final class EdgeActionVersionsUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActionVersions_Update.json + */ + /** + * Sample code: UpdateEdgeActionVersion. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void updateEdgeActionVersion(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeActionVersion resource = manager.edgeActionVersions() + .getWithResponse("testrg", "edgeAction1", "version1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.OTHERS)) + .apply(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentSamples.java new file mode 100644 index 000000000000..fc2e3b63164d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; + +/** + * Samples for EdgeActions AddAttachment. + */ +public final class EdgeActionsAddAttachmentSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_AddAttachment.json + */ + /** + * Sample code: AddAttachment. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void addAttachment(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .addAttachment("testrg", "edgeAction1", new EdgeActionAttachment().withAttachedResourceId( + "/subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateSamples.java new file mode 100644 index 000000000000..e8b0d2ca47c0 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.SkuType; + +/** + * Samples for EdgeActions Create. + */ +public final class EdgeActionsCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Create.json + */ + /** + * Sample code: CreateEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void createEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .define("edgeAction1") + .withRegion("global") + .withExistingResourceGroup("testrg") + .withSku(new SkuType().withName("Standard").withTier("Standard")) + .create(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteAttachmentSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteAttachmentSamples.java new file mode 100644 index 000000000000..701786b4c275 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteAttachmentSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; + +/** + * Samples for EdgeActions DeleteAttachment. + */ +public final class EdgeActionsDeleteAttachmentSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_DeleteAttachment.json + */ + /** + * Sample code: DeleteAttachment. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteAttachment(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions() + .deleteAttachment("testrg", "edgeAction1", new EdgeActionAttachment().withAttachedResourceId( + "/subscriptions/sub1/resourceGroups/rs1/providers/Microsoft.Cdn/Profiles/myProfile/afdEndpoints/ep1/routes/route1"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteSamples.java new file mode 100644 index 000000000000..6436f07303c9 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsDeleteSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActions Delete. + */ +public final class EdgeActionsDeleteSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Delete.json + */ + /** + * Sample code: DeleteEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void deleteEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().delete("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..9efdcff2d645 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActions GetByResourceGroup. + */ +public final class EdgeActionsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Get.json + */ + /** + * Sample code: GetEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void getEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().getByResourceGroupWithResponse("testrg", "edgeAction1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..c51786130099 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActions ListByResourceGroup. + */ +public final class EdgeActionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_ListByResourceGroup.json + */ + /** + * Sample code: ListEdgeActions_byResourceGroup. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void + listEdgeActionsByResourceGroup(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().listByResourceGroup("testrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListSamples.java new file mode 100644 index 000000000000..9fa2d160c857 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListSamples.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.edgeactions.generated; + +/** + * Samples for EdgeActions List. + */ +public final class EdgeActionsListSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_ListBySubscription.json + */ + /** + * Sample code: ListEdgeActions_bySubscription. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void listEdgeActionsBySubscription(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + manager.edgeActions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsUpdateSamples.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsUpdateSamples.java new file mode 100644 index 000000000000..52d30266614b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/samples/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsUpdateSamples.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.edgeactions.generated; + +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import com.azure.resourcemanager.edgeactions.models.SkuType; + +/** + * Samples for EdgeActions Update. + */ +public final class EdgeActionsUpdateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/EdgeActions_Update.json + */ + /** + * Sample code: UpdateEdgeAction. + * + * @param manager Entry point to EdgeActionsManager. + */ + public static void updateEdgeAction(com.azure.resourcemanager.edgeactions.EdgeActionsManager manager) { + EdgeAction resource = manager.edgeActions() + .getByResourceGroupWithResponse("testrg", "edgeAction1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new SkuType().withName("Standard").withTier("Standard")).apply(); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentResponseInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentResponseInnerTests.java new file mode 100644 index 000000000000..9239f272d92c --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentResponseInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionAttachmentResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionAttachmentResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionAttachmentResponseInner model + = BinaryData.fromString("{\"edgeActionId\":\"biksq\"}").toObject(EdgeActionAttachmentResponseInner.class); + Assertions.assertEquals("biksq", model.edgeActionId()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentTests.java new file mode 100644 index 000000000000..061baafd31fd --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionAttachmentTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionAttachmentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionAttachment model + = BinaryData.fromString("{\"id\":\"arhmofcqhsmy\",\"attachedResourceId\":\"rkdtmlxh\"}") + .toObject(EdgeActionAttachment.class); + Assertions.assertEquals("rkdtmlxh", model.attachedResourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionAttachment model = new EdgeActionAttachment().withAttachedResourceId("rkdtmlxh"); + model = BinaryData.fromObject(model).toObject(EdgeActionAttachment.class); + Assertions.assertEquals("rkdtmlxh", model.attachedResourceId()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterInnerTests.java new file mode 100644 index 000000000000..59f54e851440 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterInnerTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionExecutionFilterInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionExecutionFilterInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionExecutionFilterInner model = BinaryData.fromString( + "{\"properties\":{\"versionId\":\"jfddgmbmbe\",\"lastUpdateTime\":\"2021-07-17T14:29:41Z\",\"executionFilterIdentifierHeaderName\":\"pbhtqqrolfpfpsa\",\"executionFilterIdentifierHeaderValue\":\"gbquxigj\",\"provisioningState\":\"Succeeded\"},\"location\":\"jaoyfhrtx\",\"tags\":{\"l\":\"erkujys\"},\"id\":\"juvf\",\"name\":\"awrlyx\",\"type\":\"jkcpr\"}") + .toObject(EdgeActionExecutionFilterInner.class); + Assertions.assertEquals("jaoyfhrtx", model.location()); + Assertions.assertEquals("erkujys", model.tags().get("l")); + Assertions.assertEquals("jfddgmbmbe", model.properties().versionId()); + Assertions.assertEquals("pbhtqqrolfpfpsa", model.properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("gbquxigj", model.properties().executionFilterIdentifierHeaderValue()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionExecutionFilterInner model = new EdgeActionExecutionFilterInner().withLocation("jaoyfhrtx") + .withTags(mapOf("l", "erkujys")) + .withProperties(new EdgeActionExecutionFilterProperties().withVersionId("jfddgmbmbe") + .withExecutionFilterIdentifierHeaderName("pbhtqqrolfpfpsa") + .withExecutionFilterIdentifierHeaderValue("gbquxigj")); + model = BinaryData.fromObject(model).toObject(EdgeActionExecutionFilterInner.class); + Assertions.assertEquals("jaoyfhrtx", model.location()); + Assertions.assertEquals("erkujys", model.tags().get("l")); + Assertions.assertEquals("jfddgmbmbe", model.properties().versionId()); + Assertions.assertEquals("pbhtqqrolfpfpsa", model.properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("gbquxigj", model.properties().executionFilterIdentifierHeaderValue()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterListResultTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterListResultTests.java new file mode 100644 index 000000000000..b8209df01258 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterListResultTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionExecutionFilterListResult; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionExecutionFilterListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionExecutionFilterListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"versionId\":\"wu\",\"lastUpdateTime\":\"2021-11-23T03:42:10Z\",\"executionFilterIdentifierHeaderName\":\"gazxuf\",\"executionFilterIdentifierHeaderValue\":\"zuckyfi\",\"provisioningState\":\"Failed\"},\"location\":\"dfvzwdzuhty\",\"tags\":{\"hwxmnteiwa\":\"sdkf\",\"fsrpymzidnse\":\"pvkmijcmmxdcuf\",\"yc\":\"cxtbzsg\",\"mdwzjeiachboo\":\"sne\"},\"id\":\"flnrosfqpteehzz\",\"name\":\"ypyqrimzinp\",\"type\":\"swjdkirso\"}],\"nextLink\":\"qxhcrmn\"}") + .toObject(EdgeActionExecutionFilterListResult.class); + Assertions.assertEquals("dfvzwdzuhty", model.value().get(0).location()); + Assertions.assertEquals("sdkf", model.value().get(0).tags().get("hwxmnteiwa")); + Assertions.assertEquals("wu", model.value().get(0).properties().versionId()); + Assertions.assertEquals("gazxuf", model.value().get(0).properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("zuckyfi", model.value().get(0).properties().executionFilterIdentifierHeaderValue()); + Assertions.assertEquals("qxhcrmn", model.nextLink()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterPropertiesTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterPropertiesTests.java new file mode 100644 index 000000000000..dd9537a68eaa --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFilterPropertiesTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionExecutionFilterPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionExecutionFilterProperties model = BinaryData.fromString( + "{\"versionId\":\"nwbxgjvtbvpyssz\",\"lastUpdateTime\":\"2021-04-18T15:39:17Z\",\"executionFilterIdentifierHeaderName\":\"rujqg\",\"executionFilterIdentifierHeaderValue\":\"hmuouqfprwzwbn\",\"provisioningState\":\"Canceled\"}") + .toObject(EdgeActionExecutionFilterProperties.class); + Assertions.assertEquals("nwbxgjvtbvpyssz", model.versionId()); + Assertions.assertEquals("rujqg", model.executionFilterIdentifierHeaderName()); + Assertions.assertEquals("hmuouqfprwzwbn", model.executionFilterIdentifierHeaderValue()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionExecutionFilterProperties model + = new EdgeActionExecutionFilterProperties().withVersionId("nwbxgjvtbvpyssz") + .withExecutionFilterIdentifierHeaderName("rujqg") + .withExecutionFilterIdentifierHeaderValue("hmuouqfprwzwbn"); + model = BinaryData.fromObject(model).toObject(EdgeActionExecutionFilterProperties.class); + Assertions.assertEquals("nwbxgjvtbvpyssz", model.versionId()); + Assertions.assertEquals("rujqg", model.executionFilterIdentifierHeaderName()); + Assertions.assertEquals("hmuouqfprwzwbn", model.executionFilterIdentifierHeaderValue()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateMockTests.java new file mode 100644 index 000000000000..9cdc0acec699 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersCreateMockTests.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilterProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionExecutionFiltersCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"versionId\":\"kn\",\"lastUpdateTime\":\"2021-06-12T03:44:06Z\",\"executionFilterIdentifierHeaderName\":\"scwsv\",\"executionFilterIdentifierHeaderValue\":\"xotogtwrupqsxv\",\"provisioningState\":\"Succeeded\"},\"location\":\"ykvceoveil\",\"tags\":{\"jfcn\":\"oty\",\"x\":\"bkc\",\"nv\":\"hbttkphyw\",\"qnermclfplphoxu\":\"t\"},\"id\":\"crpab\",\"name\":\"ye\",\"type\":\"sbj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionExecutionFilter response = manager.edgeActionExecutionFilters() + .define("ovplw") + .withRegion("es") + .withExistingEdgeAction("xbzpfzab", "lcuhxwtctyqiklb") + .withTags(mapOf("xpkd", "lopwiyig", "iuebbaumny", "zb", "txp", "upedeojnabckhs")) + .withProperties(new EdgeActionExecutionFilterProperties().withVersionId("hvgyuguosvmk") + .withExecutionFilterIdentifierHeaderName("sxqu") + .withExecutionFilterIdentifierHeaderValue("kfplgmgsxnk")) + .create(); + + Assertions.assertEquals("ykvceoveil", response.location()); + Assertions.assertEquals("oty", response.tags().get("jfcn")); + Assertions.assertEquals("kn", response.properties().versionId()); + Assertions.assertEquals("scwsv", response.properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("xotogtwrupqsxv", response.properties().executionFilterIdentifierHeaderValue()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetWithResponseMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetWithResponseMockTests.java new file mode 100644 index 000000000000..b4d0be0c0e00 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionExecutionFiltersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"versionId\":\"gsncghkjeszz\",\"lastUpdateTime\":\"2021-03-22T00:42:17Z\",\"executionFilterIdentifierHeaderName\":\"ijhtxf\",\"executionFilterIdentifierHeaderValue\":\"gx\",\"provisioningState\":\"Upgrading\"},\"location\":\"xnehmpvec\",\"tags\":{\"flz\":\"debfqkkrbmpukgri\",\"qzahmgkbrp\":\"fbxzpuzycisp\",\"hibnuqqkpika\":\"y\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionExecutionFilter response = manager.edgeActionExecutionFilters() + .getWithResponse("phxepcyvahf", "ljkyqxjvuuj", "gidokgjljyoxgvcl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xnehmpvec", response.location()); + Assertions.assertEquals("debfqkkrbmpukgri", response.tags().get("flz")); + Assertions.assertEquals("gsncghkjeszz", response.properties().versionId()); + Assertions.assertEquals("ijhtxf", response.properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("gx", response.properties().executionFilterIdentifierHeaderValue()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionMockTests.java new file mode 100644 index 000000000000..90ff0e9faa8c --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionExecutionFiltersListByEdgeActionMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionExecutionFilter; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionExecutionFiltersListByEdgeActionMockTests { + @Test + public void testListByEdgeAction() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"versionId\":\"ywn\",\"lastUpdateTime\":\"2021-02-02T13:59:36Z\",\"executionFilterIdentifierHeaderName\":\"nrs\",\"executionFilterIdentifierHeaderValue\":\"nlqidybyxczf\",\"provisioningState\":\"Canceled\"},\"location\":\"axdbabph\",\"tags\":{\"cocmnyyaztt\":\"qlfktsths\",\"edckzywbiexzfey\":\"twwrqp\",\"ujwb\":\"eaxib\",\"zjancuxr\":\"qwalmuzyoxaepd\"},\"id\":\"d\",\"name\":\"bavxbniwdjswzt\",\"type\":\"dbpgnxytxhp\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.edgeActionExecutionFilters() + .listByEdgeAction("ttdbhrbnl", "nkxmyskpbhenbtk", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("axdbabph", response.iterator().next().location()); + Assertions.assertEquals("qlfktsths", response.iterator().next().tags().get("cocmnyyaztt")); + Assertions.assertEquals("ywn", response.iterator().next().properties().versionId()); + Assertions.assertEquals("nrs", response.iterator().next().properties().executionFilterIdentifierHeaderName()); + Assertions.assertEquals("nlqidybyxczf", + response.iterator().next().properties().executionFilterIdentifierHeaderValue()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionInnerTests.java new file mode 100644 index 000000000000..f78bed2a2c03 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionInnerTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionProperties; +import com.azure.resourcemanager.edgeactions.models.SkuType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"attachments\":[{\"id\":\"uv\",\"attachedResourceId\":\"jxpybczmeh\"},{\"id\":\"tzopbsphrupidgsy\",\"attachedResourceId\":\"bejhphoycmsxa\"},{\"id\":\"bhdxbm\",\"attachedResourceId\":\"qioqjzehtbmu\"},{\"id\":\"p\",\"attachedResourceId\":\"wnoi\"}]},\"sku\":{\"name\":\"hwlrx\",\"tier\":\"bqsoqijg\"},\"location\":\"mbpazlobcufpdzn\",\"tags\":{\"foooj\":\"cqqjnqglhqgn\"},\"id\":\"wifsq\",\"name\":\"saagdf\",\"type\":\"glzlhjxrifkwmrv\"}") + .toObject(EdgeActionInner.class); + Assertions.assertEquals("mbpazlobcufpdzn", model.location()); + Assertions.assertEquals("cqqjnqglhqgn", model.tags().get("foooj")); + Assertions.assertEquals("hwlrx", model.sku().name()); + Assertions.assertEquals("bqsoqijg", model.sku().tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionInner model = new EdgeActionInner().withLocation("mbpazlobcufpdzn") + .withTags(mapOf("foooj", "cqqjnqglhqgn")) + .withProperties(new EdgeActionProperties()) + .withSku(new SkuType().withName("hwlrx").withTier("bqsoqijg")); + model = BinaryData.fromObject(model).toObject(EdgeActionInner.class); + Assertions.assertEquals("mbpazlobcufpdzn", model.location()); + Assertions.assertEquals("cqqjnqglhqgn", model.tags().get("foooj")); + Assertions.assertEquals("hwlrx", model.sku().name()); + Assertions.assertEquals("bqsoqijg", model.sku().tier()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionListResultTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionListResultTests.java new file mode 100644 index 000000000000..52fcb5d16b22 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionListResultTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionListResult; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"attachments\":[{\"id\":\"whfpmrqobmtu\",\"attachedResourceId\":\"knryrtihfxtij\"}]},\"sku\":{\"name\":\"pzvgnwzsymglzufc\",\"tier\":\"zk\"},\"location\":\"dbihanufhfcbj\",\"tags\":{\"xqhabi\":\"git\"},\"id\":\"pikxwczbyscnpqxu\",\"name\":\"ivyqniwbybrkxvd\",\"type\":\"mjgr\"},{\"properties\":{\"provisioningState\":\"Failed\",\"attachments\":[{\"id\":\"k\",\"attachedResourceId\":\"gaudcc\"},{\"id\":\"nhsjcnyej\",\"attachedResourceId\":\"kryhtnapczwlokj\"}]},\"sku\":{\"name\":\"emkkvnipjox\",\"tier\":\"jnchgej\"},\"location\":\"odmailzyd\",\"tags\":{\"wixjsprozvcp\":\"jwyahuxinpmqnja\"},\"id\":\"tegjvwmf\",\"name\":\"atscmd\",\"type\":\"pjhulsuuvmkj\"},{\"properties\":{\"provisioningState\":\"Provisioning\",\"attachments\":[{\"id\":\"f\",\"attachedResourceId\":\"dio\"},{\"id\":\"jpslwejd\",\"attachedResourceId\":\"vwryoqpso\"},{\"id\":\"cctazakljlahbc\",\"attachedResourceId\":\"yffdfdos\"}]},\"sku\":{\"name\":\"gexpaojakhmsbz\",\"tier\":\"hcrzevd\"},\"location\":\"lxaolthqtrgqjbp\",\"tags\":{\"n\":\"s\",\"wzo\":\"gvfcj\",\"np\":\"xjtfelluwfzit\",\"lxofpdvhpfxxypin\":\"qfpjk\"},\"id\":\"nmayhuybb\",\"name\":\"podepoo\",\"type\":\"inuvamiheogn\"},{\"properties\":{\"provisioningState\":\"Upgrading\",\"attachments\":[{\"id\":\"theotusiv\",\"attachedResourceId\":\"evcciqihnhun\"}]},\"sku\":{\"name\":\"bwjzr\",\"tier\":\"fygxgispemvtzfk\"},\"location\":\"ubljofxqe\",\"tags\":{\"jqul\":\"aeqjhqjbasvms\"},\"id\":\"gsntnbybkzgcwr\",\"name\":\"clxxwrljdo\",\"type\":\"skcqvkocrcjd\"}],\"nextLink\":\"tnhxbn\"}") + .toObject(EdgeActionListResult.class); + Assertions.assertEquals("dbihanufhfcbj", model.value().get(0).location()); + Assertions.assertEquals("git", model.value().get(0).tags().get("xqhabi")); + Assertions.assertEquals("pzvgnwzsymglzufc", model.value().get(0).sku().name()); + Assertions.assertEquals("zk", model.value().get(0).sku().tier()); + Assertions.assertEquals("tnhxbn", model.nextLink()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionPropertiesTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionPropertiesTests.java new file mode 100644 index 000000000000..b99d1820c3e3 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionPropertiesTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.models.EdgeActionProperties; + +public final class EdgeActionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Provisioning\",\"attachments\":[{\"id\":\"zntocipaouajps\",\"attachedResourceId\":\"ucmpoyfd\"},{\"id\":\"fogknygjofjdde\",\"attachedResourceId\":\"s\"},{\"id\":\"deupewnwrei\",\"attachedResourceId\":\"jzyflu\"}]}") + .toObject(EdgeActionProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionProperties model = new EdgeActionProperties(); + model = BinaryData.fromObject(model).toObject(EdgeActionProperties.class); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionInnerTests.java new file mode 100644 index 000000000000..ed72e598347d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionInnerTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionInner; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionVersionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionVersionInner model = BinaryData.fromString( + "{\"properties\":{\"deploymentType\":\"others\",\"validationStatus\":\"Failed\",\"provisioningState\":\"Succeeded\",\"isDefaultVersion\":\"False\",\"lastPackageUpdateTime\":\"2021-03-29T12:58Z\"},\"location\":\"p\",\"tags\":{\"xsabkyqdu\":\"zlljfmppeebvm\"},\"id\":\"jitcjczdzevn\",\"name\":\"hkr\",\"type\":\"pdappds\"}") + .toObject(EdgeActionVersionInner.class); + Assertions.assertEquals("p", model.location()); + Assertions.assertEquals("zlljfmppeebvm", model.tags().get("xsabkyqdu")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.OTHERS, model.properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.FALSE, model.properties().isDefaultVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionVersionInner model = new EdgeActionVersionInner().withLocation("p") + .withTags(mapOf("xsabkyqdu", "zlljfmppeebvm")) + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.OTHERS) + .withIsDefaultVersion(EdgeActionIsDefaultVersion.FALSE)); + model = BinaryData.fromObject(model).toObject(EdgeActionVersionInner.class); + Assertions.assertEquals("p", model.location()); + Assertions.assertEquals("zlljfmppeebvm", model.tags().get("xsabkyqdu")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.OTHERS, model.properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.FALSE, model.properties().isDefaultVersion()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionListResultTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionListResultTests.java new file mode 100644 index 000000000000..72873e5c3ab9 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionListResultTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.implementation.models.EdgeActionVersionListResult; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionVersionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionVersionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"deploymentType\":\"file\",\"validationStatus\":\"Succeeded\",\"provisioningState\":\"Upgrading\",\"isDefaultVersion\":\"True\",\"lastPackageUpdateTime\":\"2021-04-13T11:18:15Z\"},\"location\":\"je\",\"tags\":{\"hugjzzdatqxhoc\":\"rl\",\"ozwyiftyhxhuro\":\"geablgphuticndvk\"},\"id\":\"ftyxolniw\",\"name\":\"wcukjfkgiawxk\",\"type\":\"ryplwckbasyypn\"},{\"properties\":{\"deploymentType\":\"others\",\"validationStatus\":\"Succeeded\",\"provisioningState\":\"Canceled\",\"isDefaultVersion\":\"False\",\"lastPackageUpdateTime\":\"2021-07-04T18:56:23Z\"},\"location\":\"phejkotynqgoulz\",\"tags\":{\"wyqkgfgibm\":\"i\",\"qsrxybzqqed\":\"dgak\",\"iqfouflmmnkz\":\"ytb\"},\"id\":\"modmglougpb\",\"name\":\"wtmutduq\",\"type\":\"ta\"}],\"nextLink\":\"pwgcuertu\"}") + .toObject(EdgeActionVersionListResult.class); + Assertions.assertEquals("je", model.value().get(0).location()); + Assertions.assertEquals("rl", model.value().get(0).tags().get("hugjzzdatqxhoc")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.FILE, + model.value().get(0).properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, model.value().get(0).properties().isDefaultVersion()); + Assertions.assertEquals("pwgcuertu", model.nextLink()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionPropertiesInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionPropertiesInnerTests.java new file mode 100644 index 000000000000..71365476e6ac --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionPropertiesInnerTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import org.junit.jupiter.api.Assertions; + +public final class EdgeActionVersionPropertiesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EdgeActionVersionPropertiesInner model = BinaryData.fromString( + "{\"deploymentType\":\"zip\",\"validationStatus\":\"Failed\",\"provisioningState\":\"Upgrading\",\"isDefaultVersion\":\"True\",\"lastPackageUpdateTime\":\"2021-04-24T00:01:09Z\"}") + .toObject(EdgeActionVersionPropertiesInner.class); + Assertions.assertEquals(EdgeActionVersionDeploymentType.ZIP, model.deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, model.isDefaultVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EdgeActionVersionPropertiesInner model + = new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.ZIP) + .withIsDefaultVersion(EdgeActionIsDefaultVersion.TRUE); + model = BinaryData.fromObject(model).toObject(EdgeActionVersionPropertiesInner.class); + Assertions.assertEquals(EdgeActionVersionDeploymentType.ZIP, model.deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, model.isDefaultVersion()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateMockTests.java new file mode 100644 index 000000000000..727fc8b39f3f --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsCreateMockTests.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.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.fluent.models.EdgeActionVersionPropertiesInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionVersionsCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"deploymentType\":\"others\",\"validationStatus\":\"Failed\",\"provisioningState\":\"Succeeded\",\"isDefaultVersion\":\"True\",\"lastPackageUpdateTime\":\"2021-11-30T06:51:56Z\"},\"location\":\"conuqszfkbeype\",\"tags\":{\"kt\":\"jmwvvj\",\"ffrzpwvlqdqgbiqy\":\"xsenhwlr\",\"vf\":\"ihkaetcktvfc\"},\"id\":\"nkymuctqhjfbebrj\",\"name\":\"xerf\",\"type\":\"wutttxfvjrbi\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionVersion response = manager.edgeActionVersions() + .define("bin") + .withRegion("wnuzoqftiyqzrnkc") + .withExistingEdgeAction("wkgshwa", "kix") + .withTags(mapOf("qqn", "xlwhzlsicoh")) + .withProperties( + new EdgeActionVersionPropertiesInner().withDeploymentType(EdgeActionVersionDeploymentType.OTHERS) + .withIsDefaultVersion(EdgeActionIsDefaultVersion.TRUE)) + .create(); + + Assertions.assertEquals("conuqszfkbeype", response.location()); + Assertions.assertEquals("jmwvvj", response.tags().get("kt")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.OTHERS, response.properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, response.properties().isDefaultVersion()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeMockTests.java new file mode 100644 index 000000000000..989a613ccb5b --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsDeployVersionCodeMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionVersionsDeployVersionCodeMockTests { + @Test + public void testDeployVersionCode() throws Exception { + String responseStr + = "{\"deploymentType\":\"file\",\"validationStatus\":\"Succeeded\",\"provisioningState\":\"Failed\",\"isDefaultVersion\":\"True\",\"lastPackageUpdateTime\":\"2021-10-09T04:22:59Z\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionVersionProperties response = manager.edgeActionVersions() + .deployVersionCode("dng", "pocipazyxoegu", "g", + new VersionCodeInner().withContent("npiucgygevqznty").withName("mrbpizcdrqj"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(EdgeActionVersionDeploymentType.FILE, response.deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, response.isDefaultVersion()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeMockTests.java new file mode 100644 index 000000000000..9024d0fad749 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetVersionCodeMockTests.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.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.VersionCode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionVersionsGetVersionCodeMockTests { + @Test + public void testGetVersionCode() throws Exception { + String responseStr = "{\"content\":\"jdeyeamdpha\",\"name\":\"alpbuxwgipwhon\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + VersionCode response = manager.edgeActionVersions() + .getVersionCode("yhxdeoejzicwi", "sjttgzfbish", "bkh", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("jdeyeamdpha", response.content()); + Assertions.assertEquals("alpbuxwgipwhon", response.name()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetWithResponseMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..cd9f5a53828f --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionVersionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"deploymentType\":\"file\",\"validationStatus\":\"Succeeded\",\"provisioningState\":\"Canceled\",\"isDefaultVersion\":\"False\",\"lastPackageUpdateTime\":\"2021-07-26T12:29:54Z\"},\"location\":\"zb\",\"tags\":{\"zdobpxjmflbvvnch\":\"sovmyokacspkwl\",\"ajiwkuo\":\"kcciwwzjuqkhr\",\"sauuimj\":\"oskg\"},\"id\":\"vxieduugidyj\",\"name\":\"rfbyaosvexcso\",\"type\":\"pclhocohslk\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionVersion response = manager.edgeActionVersions() + .getWithResponse("jsllrmv", "d", "watkpnpulexxb", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zb", response.location()); + Assertions.assertEquals("sovmyokacspkwl", response.tags().get("zdobpxjmflbvvnch")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.FILE, response.properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.FALSE, response.properties().isDefaultVersion()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionMockTests.java new file mode 100644 index 000000000000..ea47d7f083e7 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionVersionsListByEdgeActionMockTests.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.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionIsDefaultVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersion; +import com.azure.resourcemanager.edgeactions.models.EdgeActionVersionDeploymentType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionVersionsListByEdgeActionMockTests { + @Test + public void testListByEdgeAction() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"deploymentType\":\"zip\",\"validationStatus\":\"Succeeded\",\"provisioningState\":\"Succeeded\",\"isDefaultVersion\":\"True\",\"lastPackageUpdateTime\":\"2021-02-27T12:32:19Z\"},\"location\":\"shxmzsbbzoggigrx\",\"tags\":{\"jnspydp\":\"rvjx\"},\"id\":\"koen\",\"name\":\"ou\",\"type\":\"nvudwtiukb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.edgeActionVersions() + .listByEdgeAction("vleggzfbuhfmvfax", "ffeii", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("shxmzsbbzoggigrx", response.iterator().next().location()); + Assertions.assertEquals("rvjx", response.iterator().next().tags().get("jnspydp")); + Assertions.assertEquals(EdgeActionVersionDeploymentType.ZIP, + response.iterator().next().properties().deploymentType()); + Assertions.assertEquals(EdgeActionIsDefaultVersion.TRUE, + response.iterator().next().properties().isDefaultVersion()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentMockTests.java new file mode 100644 index 000000000000..161c1c486d0d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsAddAttachmentMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachment; +import com.azure.resourcemanager.edgeactions.models.EdgeActionAttachmentResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionsAddAttachmentMockTests { + @Test + public void testAddAttachment() throws Exception { + String responseStr = "{\"edgeActionId\":\"ase\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeActionAttachmentResponse response = manager.edgeActions() + .addAttachment("c", "aqw", new EdgeActionAttachment().withAttachedResourceId("xnj"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ase", response.edgeActionId()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateMockTests.java new file mode 100644 index 000000000000..6ddcd2367719 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsCreateMockTests.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.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import com.azure.resourcemanager.edgeactions.models.EdgeActionProperties; +import com.azure.resourcemanager.edgeactions.models.SkuType; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionsCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"attachments\":[{\"id\":\"yvxyqjp\",\"attachedResourceId\":\"cattpngjcrcczsq\"},{\"id\":\"jh\",\"attachedResourceId\":\"mdajv\"},{\"id\":\"ysou\",\"attachedResourceId\":\"q\"},{\"id\":\"canoaeupf\",\"attachedResourceId\":\"yhltrpmopjmcm\"}]},\"sku\":{\"name\":\"tuo\",\"tier\":\"thfuiuaodsfcpkvx\"},\"location\":\"puozmyzydag\",\"tags\":{\"dxwzywqsmbsurexi\":\"xbezyiuokktwh\",\"yocf\":\"o\",\"uxh\":\"fksymddystki\"},\"id\":\"yudxorrqnbp\",\"name\":\"czvyifq\",\"type\":\"vkd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeAction response = manager.edgeActions() + .define("enjbdlwtgrhp") + .withRegion("udwxdndnvowguj") + .withExistingResourceGroup("pheoflokeyy") + .withSku(new SkuType().withName("dejbavo").withTier("xzdmohctb")) + .withTags(mapOf("zj", "wdkcglhsl", "kuofqweykhme", "yggdtjixh", "yvdcsitynnaa", "evfyexfwhybcib")) + .withProperties(new EdgeActionProperties()) + .create(); + + Assertions.assertEquals("puozmyzydag", response.location()); + Assertions.assertEquals("xbezyiuokktwh", response.tags().get("dxwzywqsmbsurexi")); + Assertions.assertEquals("tuo", response.sku().name()); + Assertions.assertEquals("thfuiuaodsfcpkvx", response.sku().tier()); + } + + // 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/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupWithResponseMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..e1823c58f0aa --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Provisioning\",\"attachments\":[{\"id\":\"rcjxvsnbyxqabn\",\"attachedResourceId\":\"ocpcy\"},{\"id\":\"hurzafblj\",\"attachedResourceId\":\"gpbtoqcjmklj\"},{\"id\":\"vbqid\",\"attachedResourceId\":\"qajzyulpkudjkr\"}]},\"sku\":{\"name\":\"khbzhfepgzg\",\"tier\":\"e\"},\"location\":\"locx\",\"tags\":{\"sglumma\":\"aierhhb\",\"xkqpxo\":\"tjaodxobnb\"},\"id\":\"ajionpimexgstxg\",\"name\":\"po\",\"type\":\"gmaajrm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + EdgeAction response = manager.edgeActions() + .getByResourceGroupWithResponse("hjtckwhd", "oifiyipjxsqwpgr", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("locx", response.location()); + Assertions.assertEquals("aierhhb", response.tags().get("sglumma")); + Assertions.assertEquals("khbzhfepgzg", response.sku().name()); + Assertions.assertEquals("e", response.sku().tier()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..1d10a963c54a --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListByResourceGroupMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Upgrading\",\"attachments\":[{\"id\":\"ijcoejctb\",\"attachedResourceId\":\"aqsqsycbkbfk\"},{\"id\":\"ukdkexxppofmxa\",\"attachedResourceId\":\"c\"}]},\"sku\":{\"name\":\"jpgd\",\"tier\":\"toc\"},\"location\":\"xhvpmoue\",\"tags\":{\"xqbzvddntwnd\":\"zxibqeoj\",\"vuhrhcffcyddgl\":\"icbtwnpzao\",\"xmqci\":\"jthjqkwpyei\",\"hkh\":\"q\"},\"id\":\"xuigdtopbobj\",\"name\":\"ghmewuam\",\"type\":\"uhrzayvvt\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.edgeActions().listByResourceGroup("djwzrlov", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xhvpmoue", response.iterator().next().location()); + Assertions.assertEquals("zxibqeoj", response.iterator().next().tags().get("xqbzvddntwnd")); + Assertions.assertEquals("jpgd", response.iterator().next().sku().name()); + Assertions.assertEquals("toc", response.iterator().next().sku().tier()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListMockTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListMockTests.java new file mode 100644 index 000000000000..1e7d9be40e1d --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/EdgeActionsListMockTests.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.edgeactions.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.edgeactions.EdgeActionsManager; +import com.azure.resourcemanager.edgeactions.models.EdgeAction; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class EdgeActionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"attachments\":[{\"id\":\"giotkftutqxlngx\",\"attachedResourceId\":\"efgugnxk\"}]},\"sku\":{\"name\":\"xdqmidtthzrvqdra\",\"tier\":\"hjybigehoqfbo\"},\"location\":\"kanyktzlcuiywg\",\"tags\":{\"gpphrcgyn\":\"gndrvynh\",\"fsxlzevgbmqjqa\":\"ocpecfvmmco\",\"pmivkwlzu\":\"c\",\"ebxetqgtzxdp\":\"ccfwnfnbacfion\"},\"id\":\"qbqqwxr\",\"name\":\"feallnwsu\",\"type\":\"isnjampmngnz\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + EdgeActionsManager manager = EdgeActionsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.edgeActions().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("kanyktzlcuiywg", response.iterator().next().location()); + Assertions.assertEquals("gndrvynh", response.iterator().next().tags().get("gpphrcgyn")); + Assertions.assertEquals("xdqmidtthzrvqdra", response.iterator().next().sku().name()); + Assertions.assertEquals("hjybigehoqfbo", response.iterator().next().sku().tier()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/SkuTypeTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/SkuTypeTests.java new file mode 100644 index 000000000000..8c3564aaf2a4 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/SkuTypeTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.models.SkuType; +import org.junit.jupiter.api.Assertions; + +public final class SkuTypeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SkuType model = BinaryData.fromString("{\"name\":\"kuksjtxukcdm\",\"tier\":\"arcryuanzwuxzdxt\"}") + .toObject(SkuType.class); + Assertions.assertEquals("kuksjtxukcdm", model.name()); + Assertions.assertEquals("arcryuanzwuxzdxt", model.tier()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SkuType model = new SkuType().withName("kuksjtxukcdm").withTier("arcryuanzwuxzdxt"); + model = BinaryData.fromObject(model).toObject(SkuType.class); + Assertions.assertEquals("kuksjtxukcdm", model.name()); + Assertions.assertEquals("arcryuanzwuxzdxt", model.tier()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/VersionCodeInnerTests.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/VersionCodeInnerTests.java new file mode 100644 index 000000000000..47fe0e026831 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/test/java/com/azure/resourcemanager/edgeactions/generated/VersionCodeInnerTests.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.edgeactions.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.edgeactions.fluent.models.VersionCodeInner; +import org.junit.jupiter.api.Assertions; + +public final class VersionCodeInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VersionCodeInner model + = BinaryData.fromString("{\"content\":\"kdosvqw\",\"name\":\"bmdg\"}").toObject(VersionCodeInner.class); + Assertions.assertEquals("kdosvqw", model.content()); + Assertions.assertEquals("bmdg", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VersionCodeInner model = new VersionCodeInner().withContent("kdosvqw").withName("bmdg"); + model = BinaryData.fromObject(model).toObject(VersionCodeInner.class); + Assertions.assertEquals("kdosvqw", model.content()); + Assertions.assertEquals("bmdg", model.name()); + } +} diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/tsp-location.yaml b/sdk/edgeactions/azure-resourcemanager-edgeactions/tsp-location.yaml new file mode 100644 index 000000000000..e3849c629d91 --- /dev/null +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cdn/resource-manager/Microsoft.Cdn/EdgeActions +commit: be46becafeb29aa993898709e35759d3643b2809 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/edgeactions/ci.yml b/sdk/edgeactions/ci.yml new file mode 100644 index 000000000000..e5d1186db161 --- /dev/null +++ b/sdk/edgeactions/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/edgeactions/ci.yml + - sdk/edgeactions/azure-resourcemanager-edgeactions/ + exclude: + - sdk/edgeactions/pom.xml + - sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeactions/ci.yml + - sdk/edgeactions/azure-resourcemanager-edgeactions/ + exclude: + - sdk/edgeactions/pom.xml + - sdk/edgeactions/azure-resourcemanager-edgeactions/pom.xml + +parameters: + - name: release_azureresourcemanageredgeactions + displayName: azure-resourcemanager-edgeactions + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: edgeactions + Artifacts: + - name: azure-resourcemanager-edgeactions + groupId: com.azure.resourcemanager + safeName: azureresourcemanageredgeactions + releaseInBatch: ${{ parameters.release_azureresourcemanageredgeactions }} diff --git a/sdk/edgeactions/pom.xml b/sdk/edgeactions/pom.xml new file mode 100644 index 000000000000..0dd16a8b3418 --- /dev/null +++ b/sdk/edgeactions/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-edgeactions-service + pom + 1.0.0 + + + azure-resourcemanager-edgeactions + +